The function that creates an Exception is only called, when an Exception is needed.
Actual Behavior
The function that creates an Exception to throw, if the status doesn't match, is always called, even when the status matches.
Mention any other details that might be useful
Yaapii.Atoms.FailWhen takes an exception, so the Func is being executed to build FailWhen from the result.
Use an if statement instead of FailWhen and only execute the Func when needed.
Expected Behavior
The function that creates an Exception is only called, when an Exception is needed.
Actual Behavior
The function that creates an Exception to throw, if the status doesn't match, is always called, even when the status matches.
Mention any other details that might be useful
Yaapii.Atoms.FailWhen takes an exception, so the Func is being executed to build FailWhen from the result.
Use an if statement instead of FailWhen and only execute the Func when needed.
Steps to reproduce the behavior
The log given by the failure.