public async Task CompleteAsyncOrDispose_CleansUpAfterTransfer() { var clientMock = new DocumentDbWriteClientMock(); var configurationMock = Mocks .Of <IDocumentDbBulkSinkAdapterInstanceConfiguration>(m => m.CollectionName == "TestCollection" && m.BatchSize == 5 && m.MaxScriptSize == 1024) .First(); using (var adapter = new DocumentDbBulkSinkAdapter(clientMock, PassThroughTransformation.Instance, configurationMock)) { await adapter.InitializeAsync(); await adapter.CompleteAsync(CancellationToken.None); } CollectionAssert.AreEquivalent(clientMock.CreatedStoredProcedures.ToArray(), clientMock.DeletedStoredProcedures.ToArray(), TestResources.BulkSinkAdapterDidNotCleanup); }
public async Task CompleteAsyncOrDispose_CleansUpAfterTransfer() { var clientMock = new DocumentDbWriteClientMock(); var configurationMock = Mocks .Of<IDocumentDbBulkSinkAdapterInstanceConfiguration>(m => m.Collection == "TestCollection" && m.StoredProcName == "test" && m.BatchSize == 5 && m.MaxScriptSize == 1024) .First(); using (var adapter = new DocumentDbBulkSinkAdapter(clientMock, PassThroughTransformation.Instance, configurationMock)) { await adapter.InitializeAsync(); await adapter.CompleteAsync(CancellationToken.None); } CollectionAssert.AreEquivalent(clientMock.CreatedStoredProcedures.ToArray(), clientMock.DeletedStoredProcedures.ToArray(), TestResources.BulkSinkAdapterDidNotCleanup); }