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