public void When_a_property_throws_an_exception_it_should_ignore_that_and_still_create_a_descriptive_error_message() { // Arrange var subject = new ExceptionThrowingClass(); // Act string result = Formatter.ToString(subject); // Assert result.Should().Contain("Member 'ThrowingProperty' threw an exception"); }
public void When_a_property_throws_an_exception_it_should_ignore_that_and_still_create_a_descriptive_error_message() { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var subject = new ExceptionThrowingClass(); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- string result = Formatter.ToString(subject); //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should().Contain("Property 'ThrowingProperty' threw an exception"); }