Exemplo n.º 1
0
        public void CreateDictionaryCommand_CreateQuery_1()
        {
            Mock <IIrbisConnection> mock       = GetConnectionMock();
            IIrbisConnection        connection = mock.Object;
            CreateDictionaryCommand command    = new CreateDictionaryCommand(connection);

            command.CreateQuery();
        }
Exemplo n.º 2
0
        public void CreateDictionaryCommand_CreateQuery_2()
        {
            Mock <IIrbisConnection> mock       = GetConnectionMock();
            IIrbisConnection        connection = mock.Object;
            CreateDictionaryCommand command    = new CreateDictionaryCommand(connection)
            {
                Database = "IBIS"
            };
            ClientQuery query = command.CreateQuery();

            Assert.IsNotNull(query);
        }
Exemplo n.º 3
0
        public void CreateDictionaryCommand_ExecuteRequest_1()
        {
            int returnCode = 0;
            Mock <IIrbisConnection> mock       = GetConnectionMock();
            IIrbisConnection        connection = mock.Object;
            CreateDictionaryCommand command    = new CreateDictionaryCommand(connection)
            {
                Database = "IBIS"
            };
            ResponseBuilder builder = new ResponseBuilder()
                                      .StandardHeader(CommandCode.CreateDictionary, 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);
        }