给定一个参数为的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