Exemple #1
0
            public void When_asserting_an_instance_to_not_be_in_a_certain_range_but_it_is_not_it_should_throw()
            {
                // Arrange
                var subject = new ComparableOfInt(1);

                // Act
                Action action = () =>
                                subject.Should().NotBeInRange(new ComparableOfInt(1), new ComparableOfInt(2));

                // Assert
                action.Should().Throw <XunitException>();
            }
Exemple #2
0
            public void When_assertion_an_instance_to_not_be_in_a_certain_range_and_it_is_not_it_should_succeed()
            {
                // Arrange
                var subject = new ComparableOfInt(3);

                // Act
                Action action = () =>
                                subject.Should().NotBeInRange(new ComparableOfInt(1), new ComparableOfInt(2));

                // Assert
                action.Should().NotThrow();
            }
Exemple #3
0
            public void When_assertion_an_instance_to_not_be_in_a_certain_range_but_it_is_not_it_should_throw()
            {
                // Arrange
                var subject = new ComparableOfInt(2);

                // Act
                Action action = () =>
                                subject.Should().NotBeInRange(new ComparableOfInt(1), new ComparableOfInt(2));

                // Assert
                action.Should().Throw <XunitException>()
                .WithMessage("Expected subject to not be between*and*, but found *.");
            }