Beispiel #1
0
        public void TestConstructor_DefaultBatchSize()
        {
            var testService = new TestDocumentService(context, indexService.Object, notificationService.Object);

            Assert.IsNotNull(testService.GetContext());
            Assert.IsFalse(testService.GetContext().Configuration.AutoDetectChangesEnabled);

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

            Assert.AreEqual(DocumentService <TestContext, SimpleEntity> .DEFAULT_BATCH_SIZE, batchSizeValue);
        }
Beispiel #2
0
        public void TestConstructor()
        {
            var batchSize   = 10;
            var testService = new TestDocumentService(context, indexService.Object, notificationService.Object, batchSize);

            Assert.IsNotNull(testService.GetContext());
            Assert.IsFalse(testService.GetContext().Configuration.AutoDetectChangesEnabled);

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

            Assert.AreEqual(batchSize, batchSizeValue);
        }