forked from sshnet/SSH.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectConnectorTestBase.cs
More file actions
44 lines (37 loc) · 1.26 KB
/
DirectConnectorTestBase.cs
File metadata and controls
44 lines (37 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Moq;
using Renci.SshNet.Connection;
using Renci.SshNet.Tests.Common;
namespace Renci.SshNet.Tests.Classes.Connection
{
public abstract class DirectConnectorTestBase : TripleATestBase
{
internal Mock<ISocketFactory> SocketFactoryMock { get; private set; }
internal DirectConnector Connector { get; private set; }
internal SocketFactory SocketFactory { get; private set; }
protected virtual void CreateMocks()
{
SocketFactoryMock = new Mock<ISocketFactory>(MockBehavior.Strict);
}
protected virtual void SetupData()
{
Connector = new DirectConnector(SocketFactoryMock.Object);
SocketFactory = new SocketFactory();
}
protected virtual void SetupMocks()
{
}
protected sealed override void Arrange()
{
CreateMocks();
SetupData();
SetupMocks();
}
protected ConnectionInfo CreateConnectionInfo(string hostName)
{
return new ConnectionInfo(hostName,
1027,
"user",
new KeyboardInteractiveAuthenticationMethod("user"));
}
}
}