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