public static void State_ThrowsInvalidOperationException_ForFalse_2() { // Arrange var message = "My message"; Action act = () => Enforce.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 State_DoesNotThrow_ForTrue_2() => Enforce.State(true, "My message");
public static void State_ThrowsInvalidOperationException_ForFalse_1() => Assert.Throws <InvalidOperationException>(() => Enforce.State(false));
public static void State_DoesNotThrow_ForTrue_1() => Enforce.State(true);