EzSmb icon indicating copy to clipboard operation
EzSmb copied to clipboard

No easy way to mock the connection for unit testing.

Open dulsi opened this issue 2 years ago • 0 comments

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?

dulsi avatar Mar 17 '22 18:03 dulsi