예제 #1
0
        public virtual void testQuery()
        {
            var statistics = managementService.CreateBatchStatisticsQuery()

                             .ToList();

            Assert.AreEqual(0, statistics.Count);

            var batch1 = helper.CreateMigrationBatchWithSize(1);

            statistics = managementService.CreateBatchStatisticsQuery()

                         .ToList();
            Assert.AreEqual(1, statistics.Count);
            Assert.AreEqual(batch1.Id, statistics[0].Id);

            var batch2 = helper.CreateMigrationBatchWithSize(1);
            var batch3 = helper.CreateMigrationBatchWithSize(1);

            statistics = managementService.CreateBatchStatisticsQuery()

                         .ToList();
            Assert.AreEqual(3, statistics.Count);

            helper.CompleteBatch(batch1);
            helper.CompleteBatch(batch3);

            statistics = managementService.CreateBatchStatisticsQuery()

                         .ToList();
            Assert.AreEqual(1, statistics.Count);
            Assert.AreEqual(batch2.Id, statistics[0].Id);

            helper.CompleteBatch(batch2);

            statistics = managementService.CreateBatchStatisticsQuery()

                         .ToList();
            Assert.AreEqual(0, statistics.Count);
        }