我有两个类:嘲笑值不退还
public class Foo {
public int getInt(){
return 10;
}
}
public class Bar {
Foo testClass = new Foo();
public Foo getTestClass() {
return testClass;
}
public void setTestClass(Foo testClass) {
this.testClass = testClass;
}
public int get(){
return testClass.getInt();
}
}
最后,我有测试类模拟为富:
你能告诉我,为什么我从得到10 t.get()虽然在模拟“我说”,我想要5?
我该如何写Mock来获得嘲讽价值?
在此先感谢。
看来你的模拟没有设置。 – Mistalis