January 5, 2010 by temebele
I came across a unit test that I needed to verify that a method got called but didn’t really care about the parameter being passed except that it shouldn’t be null.
After researching a bit I was able to find how to do it with Rhinomocks.
repository.AssertWasCalled(k => k.SaveAndCommit<ProposalFlight>(Arg<ProposalFlight>.Matches(s => s != null)));
I only care that a non-null parameter of the type specified gets passed.
The repository was mocked as below.