这是我的测试代码:
[Test]
public void Test_Delete_ShouldCancelLayoutView()
{
Expect.Call(TreeMasterService.Delete(1, null)).Return(null).IgnoreArguments();
Mocks.ReplayAll();
TestController.Delete(1);
}
这是受试者:
public void Delete(int id)
{
TreeMasterService.Delete(id, CurrentUser);
CancelLayout();
CancelView();
}
有没有办法确保使用Rhino Mocks调用CancelLayout()和CancelView()?