Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleCode with RowAction annotations
 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 Image Added method called to get the list of data from the fixture is query() in Java and Query() in C#.

Code Block
languagejava
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.

...