public void Dispose_Has_No_Effect_With_Null_Disposable() { var pair = new DisposableCancellationTokenPair(null, CancellationToken.None); var ex = Record.Exception(() => pair.Dispose()); Assert.Null(ex); }
public void Dispose_Disposes_Disposable() { var disposableMock = new Mock <IDisposable>(); var pair = new DisposableCancellationTokenPair(disposableMock.Object, CancellationToken.None); pair.Dispose(); disposableMock.Verify(x => x.Dispose(), Times.Once); }