public async Task MultipleDisposeCallsDontBreak() { CheckDisposeStream checkDisposeStream = new CheckDisposeStream(); CombinedAsyncStream sut = new CombinedAsyncStream(FixedTestData.CreateStreamsAsyncEnumerable(checkDisposeStream)); await sut.DisposeAsync(); sut.Dispose(); sut.Dispose(); await sut.DisposeAsync(); Assert.IsTrue(checkDisposeStream.DisposeCalled); }
public void SyncDisposeTriggersAsyncDispose() { CheckDisposeStream checkDisposeStream = new CheckDisposeStream(); CombinedAsyncStream sut = new CombinedAsyncStream(FixedTestData.CreateStreamsAsyncEnumerable(checkDisposeStream)); sut.Dispose(); Assert.IsTrue(checkDisposeStream.DisposeCalled); }