Invalid methods often change the state of an instance. In this case, your testing method should state that the expected state is present after the call. That is, you need to state the status of the respective members.
Invalid methods without side effects can also be tested using the layout. In this case, you will verify that the method makes the expected calls for the mock object.
Having said that functions similar to methods should be preferable to IMO, since they are easier to reason and easier to test, but this is only my opinion.
source share