Пример #1
0
        public void SearchCommand_ApplyParameters_1()
        {
            Mock <IIrbisConnection> mock       = GetConnectionMock();
            IIrbisConnection        connection = mock.Object;
            SearchCommand           command    = new SearchCommand(connection);
            SearchParameters        parameters = new SearchParameters
            {
                Database                = "IBIS",
                FirstRecord             = 1,
                NumberOfRecords         = 10,
                MinMfn                  = 100,
                MaxMfn                  = 200,
                SearchExpression        = "A=AUTHOR$",
                FormatSpecification     = "@brief",
                SequentialSpecification = "p(v300)"
            };

            command.ApplyParameters(parameters);
            Assert.AreEqual(parameters.Database, command.Database);
            Assert.AreEqual(parameters.FirstRecord, command.FirstRecord);
            Assert.AreEqual(parameters.NumberOfRecords, command.NumberOfRecords);
            Assert.AreEqual(parameters.MinMfn, command.MinMfn);
            Assert.AreEqual(parameters.MaxMfn, command.MaxMfn);
            Assert.AreEqual(parameters.SearchExpression, command.SearchExpression);
            Assert.AreEqual(parameters.FormatSpecification, command.FormatSpecification);
            Assert.AreEqual(parameters.SequentialSpecification, command.SequentialSpecification);
        }