public void ActualizeRecordCommand_Verify_1() { Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; ActualizeRecordCommand command = new ActualizeRecordCommand(connection); Assert.IsFalse(command.Verify(false)); }
public void ActualizeRecordCommand_CreateQuery_1() { Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; ActualizeRecordCommand command = new ActualizeRecordCommand(connection); command.CreateQuery(); }
public void ActualizeRecordCommand_Construciton_1() { Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; ActualizeRecordCommand command = new ActualizeRecordCommand(connection); Assert.AreSame(connection, command.Connection); }
public void ActualizeRecordCommand_Verify_2() { Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; ActualizeRecordCommand command = new ActualizeRecordCommand(connection) { Database = "IBIS", Mfn = 123 }; Assert.IsTrue(command.Verify(false)); }
public void ActualizeRecordCommand_CreateQuery_2() { Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; ActualizeRecordCommand command = new ActualizeRecordCommand(connection) { Database = "IBIS", Mfn = 123 }; ClientQuery query = command.CreateQuery(); Assert.IsNotNull(query); }
public void ActualizeRecordCommand_ExecuteRequest_1() { int returnCode = 0; Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; ActualizeRecordCommand command = new ActualizeRecordCommand(connection) { Database = "IBIS", Mfn = 123 }; ResponseBuilder builder = new ResponseBuilder() .StandardHeader(CommandCode.ActualizeRecord, 123, 456) .NewLine() .Append(returnCode) .NewLine(); TestingSocket socket = (TestingSocket)connection.Socket; socket.Response = builder.Encode(); ClientQuery query = command.CreateQuery(); ServerResponse response = command.Execute(query); Assert.AreEqual(returnCode, response.ReturnCode); }