Ironically enough this test is on the most basic of item - ILogService
Interface is:
Log(string message, LogType type);
Log(string message, string category, LogType type);
Test is ensuring an error in the log service doesn't bubble up and
throw an exception (that it is swallowed in the logging helper):
Test against signature Log(string message, LogType type) works fine,
it's this test against the overload that is causing problems.
MockRepository repository = new MockRepository();
ILogService logService = repository.StrictMock<ILogService>(null);
RegisterLoggerForTest(logService);
try
{
using(repository.Record())
{
logService.Log("Test", "Test", LogEventType.Verbose);
LastCall.IgnoreArguments().Throw(new System.IO.IOException());
}
DefaultLogger.Log("Test Message", "Test Category",
LogEventType.Verbose");
respository.VerifyAll();
}
finally
{
UnregisterLoggerForTest();
}
The result that I get are:
Rhino.Mocks.Exceptions.ExpectationViolationException: ILogService.Log
("Test message", Resume); Expected #0, Actual #1..
This is incorrect, this isn't the method I'm calling. It's like RM is
just ignoring the second parameter being present and goes with the
first implementation. Thinking maybe it had to do something with
IgnoreArguments() I changed to Contraints(Is.Anything(), Is.Anything
(), Is.Anything()), but this didn't matter. So then I finally
actually set the argument to match and removed the IgnoreArguments/
Constraints all together, but this didn't matter.
I need help please. Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---