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つのインスタンスですが、同じ値を持ち、アサートの前に確認されています。ここ 意味がない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());
}
コードを表示してください –