Hi,
Could anyone help me with what is probably a basic question. I
receive an InvalidOperationException from the code below at the end of
the _mocks.Record() block when I run all my tests together in NUnit
GUI. When I run the tests individually, they all run and pass with no
exception!
I am using Rhino Mocks 3.6 and NUnit 2.5.8 as part of an ASP.NET 4.0
MVC 2 project.
Here is one of my tests, am I doing something wrong with the Record/
Playback syntax?
[Test]
public void Can_render_edit_view()
{
IClockRepository repo =
_mocks.DynamicMock<IClockRepository>();
IMapper<Alarm, AlarmViewModel> mapper =
_mocks.DynamicMock<IMapper<Alarm, AlarmViewModel>>();
var controller = new AlarmController(repo, mapper);
AlarmViewModel vm = new AlarmViewModel()
{
Id = 1,
AlarmName = "Test",
AlarmTime = "12:00",
IsSet = true,
Message = "Wake up"
};
Clock clock = UnitTestHelpers.GetClockWithAlarms();
using (_mocks.Record())
{
Expect.Call(repo.GetClock()).Return(clock);
Expect.Call(mapper.Map(clock.Alarms[0])).Return(vm);
}
ActionResult result;
using (_mocks.Playback())
{
result = controller.Edit(1);
}
result.ShouldBeDefaultView();
}
Any help would be really appreciated!
Anthony
--
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.