【发布时间】:2018-02-07 17:29:49
【问题描述】:
我在 C# 中使用 Rhinomock,我想忽略方法内的调用。让我们看看,有没有人知道如何忽略(或跳过)以下代码示例中的方法 MyMethodToIgnore?使用 Rhinomock 可以做到这一点吗?
public void MyMethod()
{
string sample = string.Empty;
var n = MyMethodToIgnore(sample);
// Rest of code...
}
让我们推断 MyMethodToIgnore 执行并返回一些东西。
【问题讨论】:
-
MyMethodToIgnore返回什么类型? -
你能提供一些关于
MyMethodToIgnore的实现细节吗? -
我们推断它返回了一些东西,例如:private int MyMethodToIgnore(string sample){ return 1;}
标签: c# unit-testing rhino-mocks