Skip to content

Invoking() should allow null subjects #1732

Answered by dennisdoomen
AVee asked this question in Q&A
Discussion options

You must be logged in to vote

The intention of Invoking is to invoke members of the subject-under-test. So we don't expect the subject itself to ever be null. But you can rewrite this as:

Action act = () => ThrowOnNull(arg);
act.Should().Throw<ArgumentNullException>();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jnyrup
Comment options

Answer selected by jnyrup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1729 on November 05, 2021 06:10.