Beispiel #1
0
        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);
        }
Beispiel #2
0
 public static void State_DoesNotThrow_ForTrue_2() => Enforce.State(true, "My message");
Beispiel #3
0
 public static void State_ThrowsInvalidOperationException_ForFalse_1()
 => Assert.Throws <InvalidOperationException>(() => Enforce.State(false));
Beispiel #4
0
 public static void State_DoesNotThrow_ForTrue_1() => Enforce.State(true);