fluentassertions force exceptions
subject.Invoking(y => y.Foo("Hello"))
.Should().Throw<InvalidOperationException>()
.WithMessage("Hello is not allowed at this moment");
fluentassertions force exceptions
subject.Invoking(y => y.Foo("Hello"))
.Should().Throw<InvalidOperationException>()
.WithMessage("Hello is not allowed at this moment");
fluent assertions 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");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us