I don't understand how to interpret the following message:
Rhino.Mocks.Exceptions.ExpectationViolationException :
ITimeSheetMatrixWidget.Load
(Smack.ConstructionAdmin.Domain.TransferObjects.TimeSheetDtoAssembler
+<ToActivityDtoCollection>d__1); Expected #1, Actual #0.
Here is the interface / method Sut:
public interface ITimeSheetMatrixWidget : IMatrixWidget
{
.....
void Load(IEnumerable<DynamicDisplayDto>
activities); ....
}
Here is the test:
[Test]
public void SettingTheWidget_TriggersLoad_NonProjectActivities
()
{
var f = _getFacade();
// create test activities
TestDataFactory.SetupTestActivities(f);
Assert.That(f.NonProjectDtos.Count(), Is.GreaterThan(0));
// create the presenter
var filterService =
MockRepository.GenerateStub<IProjectFilterService>();
var view = MockRepository.GenerateStub<ITimeSheetView>();
var timeSheetPresenter = new TimeSheetPresenter(f,
filterService, view);
// inject the mocked widget & trigger the Load
var widget =
MockRepository.GenerateMock<ITimeSheetMatrixWidget>();
timeSheetPresenter.ActivityMatrix = widget;
widget.AssertWasCalled(x => x.Load(f.NonProjectDtos), mo
=> mo.IgnoreArguments()); <-- ok, but ng
//widget.AssertWasCalled(x => x.Load(f.NonProjectDtos));
<-- generates the Exception
}
I can avoid test failure by ignoring the arguments, but I'd like to
test that the load method is being called with the correct argument in
this case. The exception message is correctly picking up information
about how the facade is producing the IEnumerable<Dto> argument
itself, but I don't understand why it is doing that, or how to adjust
my test accordingly.
Thank you for your help!
Berryl
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---