public async void ReIndex_MultiBatchOfDocsInSource_ReIndexesCorrectly( IFixture fixture, DbDataFlow <EsDocument, List <EsDocument> > reindexer, ISourceScrollConfig sourceConfig, ITargetIndexingConfig targetConfig) { // arange var testSourceClient = new EsTestIndexClient( GlobalTestSettings.TestSourceServerConnectionString, sourceConfig.IndexIdentifier); var testTargetClient = new EsTestIndexClient( GlobalTestSettings.TestTargetServerConnectionString, targetConfig.Index); testSourceClient.Index( fixture.CreateMany <EsDocument>(TEST_BATCH_SIZE * 3).ToArray()); // act using (testSourceClient.ForTestAssertions()) { await reindexer.StartFlowAsync(); } // assert using (testTargetClient.ForTestAssertions()) { testTargetClient.GetAllDocs().Should().HaveCount(6); } }
public void BulkIndex_addsMultipleDoc_Successfully( EsDocument doc1, EsDocument doc2, EsDocument doc3, EsTestIndexClient testClient, IndexWorker indexWorker) { indexWorker .Index(new[] { doc1, doc2, doc3 }) .Should().Be(true); using (testClient.ForTestAssertions()) { testClient.GetAllDocs().Should().HaveCount(3); } }
public void BulkIndex_addsSingleDoc_Successfully( EsDocument doc1, EsTestIndexClient testClient, IndexWorker indexWorker) { indexWorker .Index(new List <EsDocument>() { doc1 }) .Should().Be(true); using (testClient.ForTestAssertions()) { testClient.GetAllDocs().Single().ToString().Should().Be(doc1.Data.ToString()); } }
public void ScrollPage_MultipleDocsExistOnSingleScrollPage_ReturnsDocs( EsDocument doc1, EsDocument doc2, EsDocument doc3, IndexWorker indexWorker, EsTestIndexClient testClient, ScrollWorker scrollWorker) { indexWorker.Index(new [] { doc1, doc2, doc3 }); using (testClient.ForTestAssertions()) { var actuals = scrollWorker.ScrollPage(); actuals.Should().NotBeNull(); actuals.Should().HaveCount(3); } }
public void ScrollPage_MultipleDocsExistOnMultipleScrollPages_ReturnsDocs( IFixture fixture, IndexWorker indexWorker, EsTestIndexClient testClient, ScrollWorker scrollWorker) { var testDocs = fixture.CreateMany <EsDocument>(scrollWorker.Client.Config.BatchSize * 2); indexWorker.Index(testDocs); using (testClient.ForTestAssertions()) { var actuals = scrollWorker.ScrollPage(); // first page actuals = actuals.Concat(scrollWorker.ScrollPage()); // second page scrollWorker.ScrollPage().Should().BeEmpty(); // third page is empty actuals.Should().NotBeNull(); actuals.Should().HaveSameCount(testDocs); } }