1 [TestMethod, Isolated]
2 public void FakeMethod_OnLiveObject() {
3 var dependency = new Dependency();
4 Isolate.WhenCalled(() => dependency.CheckSecurity(null, null)).IgnoreCall();//不去管这个方法的调用
5 var classUnderTest = new ClassUnderTest();
6 var result = classUnderTest.Calculate(1, 2, dependency);
7 Assert.AreEqual(3, result);
8 }