Rhino Mocks verify a private method is called from a public method
- by slowcelica
I have been trying to figure this one out, how do i test that a private method is called with rhino mocks with in the class that I am testing. So my class would be something like this.
Public class Foo
{
public bool DoSomething()
{
if(somevalue)
{
//DoSomething;
}
else
{
ReportFailure("Failure");
}
}
private void ReportFailure(string message)
{
//DoSomeStuff;
}
}
So my unit test is on class Foo and method DoSomething() I want to check and make sure that a certain message is passed to ReportFailure if somevalue is false, using rhino mocks.