1
這裏我的測試代碼嘲笑一個靜態調用:犀牛模擬,從非嘲笑對象
[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();
}
有沒有什麼辦法,以確保CancelLayout()並使用Rhino Mocks調用CancelView()?