Esempio n. 1
0
        public void When_subject_and_expectation_are_null_it_should_not_throw()
        {
            // Arrange
            SomeDto subject = null;

            // Act
            Action act = () => subject.Should().BeEquivalentTo <object>(null);

            // Assert
            act.Should().NotThrow();
        }
Esempio n. 2
0
        public void When_subject_and_expectation_are_compared_for_equivalence_with_config_it_should_allow_chaining()
        {
            // Arrange
            SomeDto subject = null;

            // Act
            Action act = () => subject.Should().BeEquivalentTo <object>(null, opt => opt)
                         .And.BeNull();

            // Assert
            act.Should().NotThrow();
        }
Esempio n. 3
0
        public void When_subject_is_null_it_should_throw()
        {
            // Arrange
            SomeDto subject = null;

            // Act
            Action act = () => subject.Should().BeEquivalentTo(new { });

            // Assert
            act.Should().Throw <XunitException>().WithMessage(
                "Expected subject*to be*, but found <null>*");
        }