Пример #1
0
        public static void State1()
        {
            Action act = () => {
                Require.State(true);
                Require.State(true, "My message");
            };

            Assert.DoesNotThrow(act);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public static void State2()
 => Assert.Throws <InvalidOperationException>(() => Require.State(false));
Пример #5
0
 public static void State_DoesNotThrow_ForTrue_2() => Require.State(true, "My message");
Пример #6
0
 public static void State_DoesNotThrow_ForTrue_1() => Require.State(true);