public static void AssertDisposingTest() { var state = new VolatileState(); Assert.That(() => AssertionUtilities.AssertDisposing(state), Configuration.AssertionsEnabled ? Throws.Exception : Throws.Nothing ); _ = state.BeginDispose(); Assert.That(() => AssertionUtilities.AssertDisposing(state), Throws.Nothing ); state.EndDispose(); Assert.That(() => AssertionUtilities.AssertDisposing(state), Configuration.AssertionsEnabled ? Throws.Exception : Throws.Nothing ); }