public void WillNotThrowException() { int count = 0; var disposable1 = new DisposableAction(() => { throw new Exception(); }); var newDisp = disposable1.ComposeWith(disposable1); newDisp.Dispose(); count.Should().Be(0); }
public void CanDisposeOneItem() { int count = 0; var disposable1 = new DisposableAction(() => count++); var newDisp = disposable1.ComposeWith(); newDisp.Dispose(); count.Should().Be(1); }
public void CanDisposeTwoItemsLIFO2() { int count = 7; var disposable1 = new DisposableAction(() => count %= 7); var disposable2 = new DisposableAction(() => count += 8); var newDisp = disposable2.ComposeWith(disposable1); newDisp.Dispose(); count.Should().Be(8); }