public QueryDocumentsCommand(ISimoConnection connection) : base(connection) { Options = QueryCommandOptions.None; NumberOfDocumentsToSkip = null; NumberOfDocumentsToReturn = null; }
public void GetPipeStream_WhileNotConnected_ThrowsException() { _connection = TestHelper.CreateConnection(); var stream = _connection.GetPipeStream(); Assert.IsNull(stream, "Pipestream shall not be returned when not connected!"); }
protected override void OnTestCleanup() { if (_connection != null && _connection.IsConnected) { _connection.Dispose(); _connection = null; } }
public void Connect_ServerIsUp_CanConnect() { _connection = TestHelper.CreateConnection(); _connection.Connect(); Assert.IsTrue(_connection.IsConnected); }
public void Connect_WhileConnected_ThrowsException() { _connection = TestHelper.CreateConnection(); _connection.Connect(); _connection.Connect(); Assert.IsTrue(_connection.IsConnected); }
public void Dispose_WhenConnected_GetsDisconnected() { _connection = TestHelper.CreateConnection(); _connection.Connect(); _connection.Dispose(); Assert.IsFalse(_connection.IsConnected); }
public void GetPipeStream_WhenConnected_ReturnsStream() { _connection = TestHelper.CreateConnection(); _connection.Connect(); using (var stream = _connection.GetPipeStream()) { Assert.IsNotNull(stream); } }
public void Connect_NoServerIsUp_ThrowsException() { var dummyHost = Guid.NewGuid().ToString(); var dummyConnectionInfo = new SimoConnectionInfo(dummyHost, SimoConnectionInfo.DefaultPort); _connection = new SimoConnection(dummyConnectionInfo); _connection.Connect(); Assert.Fail("Connect should have generated exception."); }
/// <summary> /// http://docs.mongodb.org/meta-driver/latest/legacy/implement-authentication-in-driver/ /// </summary> /// <param name="connection"></param> /// <param name="UserName"></param> /// <param name="KeyDigest"></param> /// <param name="nonce"></param> public AuthenticateCommand(ISimoConnection connection, Reconnection recCallback, string UserName, string KeyDigest, string nonce) : base(connection, recCallback, new { authenticate = 1.0, user = UserName, nonce = nonce, key = KeyDigest }) { }
public void GetPipeStream_WhenConnected_ReturnsStream() { _connection = TestHelper.CreateConnection(); _connection.Connect(); using(var stream = _connection.GetPipeStream()) { Assert.IsNotNull(stream); } }
protected virtual void OnExecute(ISimoConnection connection) { var request = GenerateRequest(); using (var requestStream = connection.GetPipeStream()) { using (var requestWriter = new RequestWriter(requestStream)) { requestWriter.Write(request); OnRequestSent(); } } }
protected virtual void OnExecute(ISimoConnection connection) { var request = GenerateRequest(); //using (var requestStream = connection.GetPipeStream()) var requestStream = connection.GetPipeStream(); //{ //using (var requestWriter = new RequestWriter(requestStream)) var requestWriter = new RequestWriter(requestStream); //{ requestWriter.Write(request); OnRequestSent(); //} //} }
public DropCollectionCommand(ISimoConnection connection) : base(connection, null) { }
public InsertDocumentsCommand(ISimoConnection connection) : base(connection) { }
protected SimoCommand(ISimoConnection connection, Reconnection OnReconnect) { Connection = connection; ReconnectionCallback = OnReconnect; }
protected SimoCommand(ISimoConnection connection) { Connection = connection; }
public UpdateDocumentsCommand(ISimoConnection connection) : base(connection) { Mode = UpdateModes.Upsert; }
public SimoSession(ISimoConnection connection) { Connection = connection; Pluralizer = SimoEngine.Instance.IoC.Resolve<ISimoPluralizer>(); }
public GetNonceCommand(ISimoConnection connection, Reconnection OnReconnect) : base(connection, OnReconnect, new { getnonce = 1.0 }) { }
public DropDatabaseCommand(ISimoConnection connection, Reconnection OnReconnect) : base(connection, OnReconnect, new { dropDatabase = 1.0 }) { }
public GetLastErrorCommand(ISimoConnection connection, Reconnection OnReconnect) : base(connection, OnReconnect, new { getlasterror = 1.0 }) { }
public DropDatabaseCommand(ISimoConnection connection) : base(connection, new { dropDatabase = 1.0 }) { }
public GetLastErrorCommand(ISimoConnection connection) : base(connection, new { getlasterror = 1.0 }) { }
public SimoSession(ISimoConnection connection) { Connection = connection; Pluralizer = SimoEngine.Instance.IoC.Resolve <ISimoPluralizer>(); }
protected DatabaseCommand(ISimoConnection connection, object command) : base(connection) { Command = command; }
public DropCollectionCommand(ISimoConnection connection, Reconnection OnReconnect) : base(connection, OnReconnect, null) { }
public UpdateDocumentsCommand(ISimoConnection connection, Reconnection recCallback) : base(connection, recCallback) { Mode = UpdateModes.Upsert; }
protected override void OnExecute(ISimoConnection connection) { InitializeResponse(); base.OnExecute(connection); }
public QueryDocumentsCommand <TDocumentInfered> CreateInfered <TDocumentInfered>(ISimoConnection connection, TDocumentInfered inferedTemplate) where TDocumentInfered : class { return(new QueryDocumentsCommand <TDocumentInfered>(connection)); }
public GetMoreCommand(ISimoConnection connection, long cursorId, int numberOfDocumentsToReturn) : base(connection) { InitialCursorId = cursorId; NumberOfDocumentsToReturn = numberOfDocumentsToReturn; }
protected override void OnExecute(ISimoConnection connection) { Command = new { drop = CollectionName }; base.OnExecute(connection); }
public DeleteDocumentsCommand(ISimoConnection connection, Reconnection recCallback) : base(connection, recCallback) { }
protected SimoResponseCommand(ISimoConnection connection) : base(connection) { InitializeResponse(); }
public DeleteDocumentsCommand(ISimoConnection connection) : base(connection) { }