Caplin Trader 4.8.0

Interface: module:br/test/Fixture

module:br/test/Fixture

Fixture is the interface for individual fixtures added to the GWTTestRunner. The purpose of a Fixture is to enable tests to manipulate and access a specific area of the system under tests using the GWT (given-when-then) BDD format.

Methods

addSubFixtures(fixtureRegistry)

This optional interface method can be implemented by a Fixture for a complex system which can be conceptually decomposed into separate sub-systems, enabling the fixture to delegate the handling of some fixture properties to the sub-fixtures. This method is called by the GWTTestRunner.
Parameters:
Name Type Description
fixtureRegistry module:br/test/FixtureRegistry The registry to which the fixtures should be registered.
Implementations:

canHandleProperty(propertyName) → {Boolean}

This method is called by the GWTTestRunner to check whether a property used in a GWT test is supported by the fixture.
Parameters:
Name Type Description
propertyName String the property name to check.
Implementations:
Returns:
true if the fixture handles the property; false otherwise.
Type
Boolean

doGiven(propertyName, value)

This method is called in order to manipulate a property on the system under test in a given clause.
Parameters:
Name Type Description
propertyName String The property to be changed.
value String The new value of the property.
Implementations:

doThen(propertyName, value)

This method is called in order to assert a property's value on the system under test.
Parameters:
Name Type Description
propertyName String The property name to assert.
value String The value to assert.
Implementations:

doWhen(propertyName, value)

This method is called in order to manipulate a property on the system under test in a when clause.
Parameters:
Name Type Description
propertyName String The property to be changed.
value String The new value of the property.
Implementations:

setUp()

This method is called just before a GWT test. This optional interface method can be implemented if the fixture is required to correctly set up the system-under-test before each test.
Implementations:

tearDown()

This method is called just after a GWT test. This optional interface method can be implemented if the fixture is required to correctly tear down the system-under-test after each test or to reset any state held in the fixture's implementation.
Implementations: