Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

fluentassertions force exceptions


[Test]
public void GreaterThan_NullAsRhs_ThrowsException()
{
    var lhs = new ClassWithOverriddenOperator();
    var rhs = (ClassWithOverriddenOperator) null;

    Action comparison = () => { var res = lhs > rhs; };

    comparison.Should().Throw<Exception>();
}

Source by nullorempty.org #
 
PREVIOUS NEXT
Tagged: #fluentassertions #force #exceptions
ADD COMMENT
Topic
Name
1+3 =