コード例 #1
0
 public void TestInit()
 {
     context             = new InMemoryEcaContext();
     indexService        = new Mock <IIndexService>();
     notificationService = new Mock <IIndexNotificationService>();
     service             = new ProgramDocumentService(context, indexService.Object, notificationService.Object, batchSize);
 }
コード例 #2
0
        public void TestConstructor()
        {
            batchSize = 1;
            service   = new ProgramDocumentService(context, indexService.Object, notificationService.Object, batchSize);
            Assert.AreEqual(batchSize, service.GetBatchSize());

            var batchSizeField = typeof(ProgramDocumentService).BaseType.GetField("batchSize", BindingFlags.Instance | BindingFlags.NonPublic);
            var batchSizeValue = batchSizeField.GetValue(service);

            Assert.AreEqual(batchSize, batchSizeValue);
        }