TOBOFixture
serves to provide a way for tests to interact with the TOBOUserService by setting
the ability for the test to act as a user who can trade on behalf of other users, setting the list of TOBO
users and accounts that the test can user to trade on behalf of, and setting and querying the selected TOBO
user and account to trade with.
Use of the Fixture assumes that a caplin.trading.testing.TOBOUserServiceStub is registered as a service on the caplin.core.ServiceRegistry with the alias "caplin.tobo-user-service".
Tests may use the TOBOFixture
to:
given("tobo.UserType = 'SUPER_USER'")
and("tobo.userCanTradeOnBehalfOf = true")
...
given("tobo.TOBOUserList = '['user1','user2']'")
and("tobo.TOBOAccountList = '['acct1','acct2']'")
...
given("tobo.TOBOUser = 'user1'")
and("tobo.TOBOAccount = 'acct5'")
...
...
then("tobo.TOBOUser = 'user1'")
and("tobo.TOBOAccount = 'acct5'")
Attributes | Name and Description |
---|---|
|
caplin.trading.testing.TOBOFixture()
Constructs a |
Attributes | Name and Description |
---|---|
|
void
canHandleProperty(String sProperty)
TradeMessageFixture handles properties 'UserType', 'userCanTradeOnBehalfOf', 'TOBOUser', 'TOBOUserList', 'TOBOAccount' and 'TOBOAccountList'. |
|
void
doGiven(String sPropertyName, Variant vValue)
This method is used to set the state of the TOBOUserService, determining whether the test can trade on behalf of a TOBO user, the test's user type, the TOBO user and account lists available to the test and the TOBO user and account to be used by the test for trading. |
|
void
doThen(String sPropertyName, Variant vValue)
This method can be used by a test to verify whether the user type and TOBO user and account on the TOBOUserService have the expected values. |
►
caplin.trading.testing.TOBOFixture()
Constructs a caplin.trading.testing.TOBOFixture
.
►
void
canHandleProperty(String sProperty)
TradeMessageFixture handles properties 'UserType', 'userCanTradeOnBehalfOf', 'TOBOUser', 'TOBOUserList', 'TOBOAccount' and 'TOBOAccountList'.
String | sProperty | The property to check. |
►
void
doGiven(String sPropertyName, Variant vValue)
This method is used to set the state of the TOBOUserService, determining whether the test can trade on behalf of a TOBO user, the test's user type, the TOBO user and account lists available to the test and the TOBO user and account to be used by the test for trading.
String | sPropertyName | The property name |
Variant | vValue | the value to check |
►
void
doThen(String sPropertyName, Variant vValue)
This method can be used by a test to verify whether the user type and TOBO user and account on the TOBOUserService have the expected values.
String | sPropertyName | The property name |
Variant | vValue | the value to set |