Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all articles
Browse latest Browse all 3862

How to properly moq ssh

$
0
0

hi all!
I'm trying to test service that using Rebex.Net.Ssh.
inside this service I use LoginAsync(username, pass) and ConnectAsync(host, port).

I've wrote this:

var sshMock = Mock.Of<Ssh>(m => m.IsConnected == true);
Mock.Get(sshMock).Setup(x => x.LoginAsync(It.IsAny<string>(), It.IsAny<int>())).Returns(Task.CompletedTask);

but faced with error - Exception thrown: 'System.NotSupportedException' in Moq.dll

What is the best way to write test with ssh components?
thank you in advance!


Viewing all articles
Browse latest Browse all 3862

Trending Articles