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); }
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); }