public void SearchRawCommand_ExecuteRequest_2() { int returnCode = 0; Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; SearchRawCommand command = new SearchRawCommand(connection) { Database = "IBIS", SearchExpression = "A=AUTHOR$", MinMfn = 0, MaxMfn = 0, SequentialSpecification = "p(v300)", FormatSpecification = "(v300/)" }; ResponseBuilder builder = new ResponseBuilder() .StandardHeader(CommandCode.Search, 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); Assert.IsNotNull(command.Found); Assert.AreEqual(0, command.Found.Length); }
public void SearchRawCommand_CreateQuery_1() { Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; SearchRawCommand command = new SearchRawCommand(connection); ClientQuery query = command.CreateQuery(); Assert.IsNotNull(query); }
public void SearchRawCommand_CreateQuery_2() { Mock <IIrbisConnection> mock = GetConnectionMock(); IIrbisConnection connection = mock.Object; SearchRawCommand command = new SearchRawCommand(connection) { Database = "IBIS", SearchExpression = "A=AUTHOR$" }; ClientQuery query = command.CreateQuery(); Assert.IsNotNull(query); }