您能帮助我实现我在下面评论栏中提到的目标,以完成样本单元测试吗?
想法是如何检查模拟对象,如果使用具有特定属性的类型实例调用其方法之一将其设置为期望值/
private IMyObject stub = MockRepository.GenerateMock<IMyObject>();
[TestMethod]
public void MakeMyJob_RecievesValidData_CallsRenderWithCorrectParameter()
{
SomeUtility.MakeMyJob(5,10,stub);
stub.AsswertWasCalled(s=>s.Render(Arg<IViewModel>.Is. //What next?
// In order to check if Render is called
// with a IViewModel instance
// whoose Person.Name property is "Peter"
}