public ServerMonitorTests() { _endPoint = new DnsEndPoint("localhost", 27017); _serverId = new ServerId(new ClusterId(), _endPoint); _connection = new MockConnection(); _mockConnectionFactory = new Mock <IConnectionFactory>(); _mockConnectionFactory .Setup(f => f.CreateConnection(_serverId, _endPoint)) .Returns(_connection); _capturedEvents = new EventCapturer(); _subject = new ServerMonitor(_serverId, _endPoint, _mockConnectionFactory.Object, Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan, _capturedEvents); }
public void Setup() { _endPoint = new DnsEndPoint("localhost", 27017); _connection = new MockConnection(); _connectionFactory = Substitute.For<IConnectionFactory>(); _connectionFactory.CreateConnection(null, null) .ReturnsForAnyArgs(_connection); _capturedEvents = new EventCapturer(); _serverId = new ServerId(new ClusterId(), _endPoint); _subject = new ServerMonitor(_serverId, _endPoint, _connectionFactory, Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan, _capturedEvents); }
public ServerMonitorTests() { _endPoint = new DnsEndPoint("localhost", 27017); _serverId = new ServerId(new ClusterId(), _endPoint); _connection = new MockConnection(); _mockConnectionFactory = new Mock<IConnectionFactory>(); _mockConnectionFactory .Setup(f => f.CreateConnection(_serverId, _endPoint)) .Returns(_connection); _capturedEvents = new EventCapturer(); _subject = new ServerMonitor(_serverId, _endPoint, _mockConnectionFactory.Object, Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan, _capturedEvents); }
public void Setup() { _endPoint = new DnsEndPoint("localhost", 27017); _connection = new MockConnection(); _connectionFactory = Substitute.For <IConnectionFactory>(); _connectionFactory.CreateConnection(null, null) .ReturnsForAnyArgs(_connection); _capturedEvents = new EventCapturer(); _serverId = new ServerId(new ClusterId(), _endPoint); _subject = new ServerMonitor(_serverId, _endPoint, _connectionFactory, Timeout.InfiniteTimeSpan, Timeout.InfiniteTimeSpan, _capturedEvents); }
public static CommandWireProtocol <BsonDocument> InitializeHelloProtocol(this ServerMonitor serverMonitor, IConnection connection) { return((CommandWireProtocol <BsonDocument>)Reflector.Invoke(serverMonitor, nameof(InitializeHelloProtocol), connection)); }
public static IConnection _connection(this ServerMonitor serverMonitor) { return((IConnection)Reflector.GetFieldValue(serverMonitor, nameof(_connection))); }