public static void State1() { Action act = () => { Require.State(true); Require.State(true, "My message"); }; Assert.DoesNotThrow(act); }
public static void State3() { var message = "My message"; Action act = () => Require.State(false, message); var ex = Record.Exception(act); Assert.NotNull(ex); Assert.IsType <InvalidOperationException>(ex); Assert.Equal(message, ex.Message); }
public static void State_ThrowsInvalidOperationException_ForFalse_2() { // Arrange var message = "My message"; Action act = () => Require.State(false, message); // Act var ex = Record.Exception(act); // Assert Assert.NotNull(ex); Assert.IsType <InvalidOperationException>(ex); Assert.Equal(message, ex.Message); }
public static void State2() => Assert.Throws <InvalidOperationException>(() => Require.State(false));
public static void State_DoesNotThrow_ForTrue_2() => Require.State(true, "My message");
public static void State_DoesNotThrow_ForTrue_1() => Require.State(true);