給定一個參數爲的Java(例如, public class Foo {
public Bar theBar(Bar bar) { /*... */ }
}
當磕碰/ foo的嘲諷,我怎麼告訴它接受任何參數和返回值呢? (Groovy的) def fooStub = Stub(Foo) {
theBar(/*what to pass here*/) >> { x -> x
有一個簡單的類: class Person {
private int age;
private String name;
public String getName(){return this.name;}
public int getAge(){return this.age;}
public void setName(String name
我可以像這樣進行測試並將where子句數據表提取到可重用塊中嗎? @Unroll
void "test that doSomething with #a and #b does not fail"(String a, String b) {
when:
doSomethingWithAandB(a, b)
then:
notThrown(Excepti