public void AsynchronousTest3() { _mongoServerConnection = new ServerConnection(MONGO_CONNECTION_STRING_BAD); _mongoServerConnection.ConnectAsyncTask(); Assert.AreEqual(MongoServerState.Disconnected, _mongoServerConnection.State); Assert.IsNotNull(_serverConnectionReturnMessage); }
public void AsynchronousTest1() { _mongoServerConnection = new ServerConnection(MONGO_CONNECTION_STRING); Assert.AreEqual(MongoServerState.Disconnected, _mongoServerConnection.State); _mongoServerConnection.ConnectAsyncTask(); System.Threading.Thread.Sleep(200); Assert.AreEqual(MongoServerState.Connected, _mongoServerConnection.State); }
public void AsynchronousTest2() { _mongoServerConnection = new ServerConnection(MONGO_CONNECTION_STRING); Assert.AreEqual(ConnectionResult.Empty, _serverConnectionResult); _mongoServerConnection.ConnectAsyncTask(); System.Threading.Thread.Sleep(200); List<string> returned = _mongoServerConnection.GetDbNamesForConnection(); Assert.AreEqual(MongoServerState.Connected, _mongoServerConnection.State); Assert.AreEqual(0,returned.Count()) ; AddMongoEntry(); returned = _mongoServerConnection.GetDbNamesForConnection(); Assert.AreEqual(1,returned.Count()); }