验证方法是在不使用IoC的情况下调用的

时间:2013-04-15 19:40:21

标签: .net unit-testing

是否可以在.NET中测试方法被调用。要求是1)不使用IoC,2)不手动编写存根等(但可以使用测试框架)。

如,

public class MyClass {

    public virtual void F1() {
     // Some code
    }

    public virtual void F2() {
     // Some code plus
     this.F1(); // -> I want to test F2 logic as a unit test but I want to make sure F1 is called
    }

}

非常感谢

0 个答案:

没有答案
相关问题