Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No easy way to mock the connection for unit testing. #18

Open
dulsi opened this issue Mar 17, 2022 · 0 comments
Open

No easy way to mock the connection for unit testing. #18

dulsi opened this issue Mar 17, 2022 · 0 comments

Comments

@dulsi
Copy link

dulsi commented Mar 17, 2022

To implement some unit tests, I've written a wrapper around some of EzSmb. Instead of calling Node.GetNode, I created ISmbHelper and SmbHelper which have a non-static method GetNode. That way I can create a MockSmbHelper that just uses the local filesystem for unit test purposes. Ideally MockSmbHelper would create MockNode derived from Node but the internal constructor doesn't allow that.
Have you consider adding some mock classes to allow people to easily unit test? Would you be open to a patch adding that? If so any concerns about the approach I outlined here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant