...
Example of fixture name with implicit import | ||||||
---|---|---|---|---|---|---|
GreenPepper will match com.xyz.stuffmystuff.FixtureName. |
You can have more than one package or namespace imported in a document. Just add more lines to the import table.
...
Definition |
---|
The RuleForInterpreter is used to express concrete and measurable business rules.
|
...
As we've seen in the Rule For definitionDefinition, a table of rules is used to express business rules of the application under development.
...
This page shows the fixture code that supports the examples introduced in the Writing a Rule For specificationSpecification documentation.
Fixture for Calculator
...
Code Block | ||||
---|---|---|---|---|
| ||||
public class InsuranceFee { private final Money salePrice; public InsuranceFee(Money salePrice) { this.salePrice = salePrice; } public Money forDownpaymentforDownPayment(Money downPayment) { return downPayment.greaterThan(salePrice.times(Ratio.percent(25))) ? Money.zero() : financedAmount( downPayment ).times( Ratio.of(25, 1000) ); } private Money financedAmount(Money downPayment) { return salePrice.minus( downPayment ); } } |
...