Esempio n. 1
0
        public void When_including_a_property_that_is_hidden_in_a_derived_class_it_should_select_the_correct_one()
        {
            // Arrange
            var b1 = new ClassThatHidesBaseClassProperty();
            var b2 = new ClassThatHidesBaseClassProperty();

            // Act / Assert
            b1.Should().BeEquivalentTo(b2, config => config.Including(b => b.Property));
        }
Esempio n. 2
0
        public void Excluding_a_property_hiding_a_base_class_property_should_not_reveal_the_latter()
        {
            // Arrange
            var b1 = new ClassThatHidesBaseClassProperty();
            var b2 = new ClassThatHidesBaseClassProperty();

            // Act
            Action act = () => b1.Should().BeEquivalentTo(b2, config => config.Excluding(b => b.Property));

            // Assert
            act.Should().Throw <InvalidOperationException>().WithMessage("*No members were found *");
        }