Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

fluent assertion exception

// fluent syntax
subject.Invoking(y => y.Foo(null))
    .Should().Throw<ArgumentNullException>();

// arrange-act-assert syntax
Action callingFooWithNull = () => subject.Foo(null);

callingFooWithNull.Should().Throw<ArgumentNullException>()
    .WithParameterName("message");
Source by fluentassertions.com #
 
PREVIOUS NEXT
Tagged: #fluent #assertion #exception
ADD COMMENT
Topic
Name
7+1 =