예제 #1
0
        public void BatchRecordFormatter_Search_1()
        {
            string database                    = "IBIS";
            string format                      = "Format";
            int    batchSize                   = 500;
            Mock <IIrbisConnection> mock       = GetMock();
            IIrbisConnection        connection = mock.Object;
            BatchRecordFormatter    batch
                = (BatchRecordFormatter)BatchRecordFormatter.Search
                  (
                      connection,
                      database,
                      format,
                      "searchQuery",
                      batchSize
                  );

            Assert.AreSame(connection, batch.Connection);
            Assert.AreSame(database, batch.Database);
            Assert.AreSame(format, batch.Format);
            Assert.AreEqual(batchSize, batch.BatchSize);
            Assert.AreEqual(3, batch.TotalRecords);
            Assert.AreEqual(0, batch.RecordsFormatted);

            mock.Verify(c => c.Search(It.IsAny <string>()), Times.Once);
        }
예제 #2
0
 public void BatchRecordFormatter_Search_1a()
 {
     string database                    = "IBIS";
     string format                      = "Format";
     int    batchSize                   = 0;
     Mock <IIrbisConnection> mock       = GetMock();
     IIrbisConnection        connection = mock.Object;
     BatchRecordFormatter    batch
         = (BatchRecordFormatter)BatchRecordFormatter.Search
           (
               connection,
               database,
               format,
               "searchQuery",
               batchSize
           );
 }