...
Code Block | ||||
---|---|---|---|---|
| ||||
public class DomainStuffFixture { private DomainStuff stuff; private int x; private int y; public void setX(int x) { this.x = x; } public void setY() { this.y = y; } @BeforeFirstExpectation public void allocateDomainStuff() { stuff = DomainStuffService.allocateDomainStuff(x, y); } public int getComputedValueOne() { return stuff.getComputedValueOne(); } public int getOtherComputedValueOgetOtherComputedValueOne() { return stuff.getOtherComputedValue(); } @AfterRow public void freeDomainStuff() { DomainStuffService.freeStuff(stuff); } // ... } |
...
The fixture code to support this example in Java is the class CanadaProvinceCodesFixture shown below.
The query method
The GreenPepper method called to get the list of data from the fixture is query() in Java and Query() in C#.
Code Block | ||
---|---|---|
| ||
public Collection query() {...} |
...
The second example in Writing a Do With specificationSpecification, shown again below, presents a more complete business flow using the bank fixture.
...