-
-
Notifications
You must be signed in to change notification settings - Fork 931
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
Add methods from BaseClient to ISftpClient #890
Comments
I am having the same issue! How are we supposed to do unit tests if we cannot mock essential methods like Connect() or Disconnect()? Since these methods are not virtual, I do not know any solution on how to mock them. If there is any, I would appreciate any help! |
@DavidErben I ended up writing my own wrapper. Quite simple: |
This is probably the only solution, but I tried to avoid it since I do not want to have stuff inside my code base which is only needed for testing. 😄 |
Also trying to avoid this 😅 Is there a reason it hasn't already been implemented? |
@utopi-polly I guess lack of time from the maintainer(s) |
I'm sure guys, but I've spending way to much time working for my paid job lately. |
Hey @benjaminoerskov , |
Thank you @karpikpl, I have updated my wrapper now :) |
@drieseng Any news on this? Do you want a hand with it? |
I just went through the
So For now I'm making my own interface |
On another note, the methods returning |
Thanks for the great suggestion on the IBaseClient, @CasperWSchmidt! This issue should theoretically be fixed in #975. |
@Owen-Krueger Any idea when this will be released? I can see the last release was on May 29, 2022. I would like to start using this asap. |
That would be up to the owner of this solution, and I'm sure they are extremely busy. If there's anything I can do to help get this released, I can sure do that. I appreciate that you're excited for it, though 😄 |
Fixed by @Owen-Krueger in #975. |
Im still having a hard time mocking some of the methods in the SftpClient.
I came across the method Connect() which does not exist in the Interface, but comes from the BaseClient.
Would it be possible to add such methods to the ISftpClient interface? Or how would you mock them?
The text was updated successfully, but these errors were encountered: