| Import |
| GreenPepper.Interpreters |
| com.greenpepper.interpreter |
Complete list of the Collection Interpreters
Rules for all the collection interpreters
The following rules applies to all the collection interpreters (list of, set of...)
Retrieving the collection of value from the fixture
A collection interpreters needs a collection of values from the fixture. The interpreters can access these values by different means.
To retrieve these values the interpreter follow the following rules.
1 A method in the class can be annotated or have the attribute CollectionProvider
2 The fixture itself can be an Array or an implementation of a Collection/ICollection
3 The fixture can have a query/Query method
The CollectionProvider annotation/attributes
ex: .JAVA
ex: .NET
The fixture is a collection
If the fixture itself is a collection or an array then it will be directly by the interpreter.
The query method
public Collection query(); for java
or
ICollection Query(); in .Net
Rules of resolution
1 First, verifying if there is a CollectionProvider annotation or attribute on the fixture class.
2 If not, verify if the fixture itself is an Array or an implementation of a Collection/ICollection
3 Third, look for a query/Query method
4 throws an exception
| rule for |
Collection Resolution |
| fixture |
query values ? |
| Fixture with a collection provider annotation |
collection |
| Fixture that implements collection |
collection |
| Fixture with a query method |
collection |
| Fixture without collection |
error |