Rhino.Mocks.Exceptions.ExpectationViolationException was unhandled by user code
Message=Service.GetCommunityLightPagered(null, 1, null, null, Data.PagingInfo);
Expected #0, Actual #1.
Service.GetCommunityLightPagered(null, 1, null, null, Data.PagingInfo);
Expected #1, Actual #0.
Source=Rhino.Mocks
2类PagingInfo
是2个实例,但具有相同的值,并在assert之前进行验证。RhinoMocks异常没有意义
这里是单元测试代码
//Arrange
GetController("user1");
//Act
using (MockRepository.Record())
{
Expect.Call(
ServiceClient.GetMock<Service>().GetUserPermissionSet(
"user1", false, false, false)).Return(
Db.User.Permissions.Where(p => p.Name == "CreateCommunity").ToArray());
}
using (MockRepository.Playback())
{
ActionResult result = Controller.ExecuteAction<int?, int?, string, string, string, string, string, string>(ServiceClient, Controller.SearchCommunities, null, null,null, null, null, CommunityTypeEnum.HighSchool, null,null);
//Assert
Assert.AreEqual(typeof(PartialViewResult), result.GetType());
}
请显示验证码 –