Caplin Trader 4.7.1

Class: module:caplin/watchlist/testing/WatchlistFixture

module:caplin/watchlist/testing/WatchlistFixture

The WatchlistFixture allows for testing of components that use the module:caplin/watchlist/WatchlistService.

The following actions are supported:

watchlistAdded
Creates a new watchlist, using module:caplin/watchlist/testing/WatchlistServiceStub#addWatchlist. The name, subject and id of the new watchlist should be provided in a pipe-separated list as follows:
given("watchlistservice.watchlistAdded = 'My Watchlist|/WATCHLIST/12345|12345'");
watchlistsRemoved
Passes the watchlists with the given id to module:caplin/watchlist/testing/WatchlistServiceStub#removeWatchlist. For example:
when("watchlistservice.watchlistsRemoved => '12345,54321'");
createRequested
Verifies if a request has been made to create a watchlist with the given name.
then("watchlistservice.createRequested => 'My Watchlist'");
disposeRequested
Verifies if a request has been made to dispose a list of watchlists with the given ids.
then("watchlistservice.disposeRequested => '12345,54321'");
createRejected
Rejects a request made to the service to create a watchlist with the given name.
when("watchlistservice.createRejected => 'My Watchlist'");
disposeRejected
Rejects a request made to the service to dispose a list of watchlist with the given ids.
when("watchlistservice.disposeRejected => '12345,54321'");
status
Sets the status of the WatchlistService to the given state, using module:caplin/watchlist/testing/WatchlistServiceStub#setStatus, e.g.:
when("watchlistservice.status => 'UNAVAILABLE'");
subjectsAddedToWatchlistRequested['WATCHLIST_ID']
Verifies that a request has been made to add subjects to a given watchlist. Takes a comma seperated list of subjects, and optionally (after a pipe) the index they were added at, e.g.:
then("watchlistservice.subjectsAddedToWatchlistRequested['12345'] => '/FX/GBPUSD,/FX/USDJPY|2'");
subjectsRemovedFromWatchlistRequested['WATCHLIST_ID']
Verifies that a request has been made to remove subjects to a given watchlist. Takes a comma seperated list of subjects, e.g.:
then("watchlistservice.subjectsRemovedFromWatchlistRequested['12345'] => '/FX/GBPUSD,/FX/USDJPY'");
watchlistRenameRequested['WATCHLIST_ID']
Verifies that a request has been made to rename a given watchlist, e.g.:
then("watchlistservice.watchlistRenameRequested['12345'] => 'a new name'");
subjectsAddedToWatchlist['WATCHLIST_ID']
Adds a comma separated list of subjects to a watchlist, using module:caplin/watchlist/testing/WatchlistStub#subjectsAdded. Can be used to add at a specific position by including an index after a pipe, e.g.:
when("watchlistservice.subjectsAddedToWatchlist['12345'] => '/FX/GBPUSD,/FX/USDJPY|2'");
subjectsRemovedFromWatchlist['WATCHLIST_ID']
Removes a comma separated list of subjects from a watchlist, using module:caplin/watchlist/testing/WatchlistStub#subjectsRemoved, e.g.:
when("watchlistservice.subjectsRemovedFromWatchlist['12345'] => '/FX/GBPUSD,/FX/USDJPY'");
watchlistRename['WATCHLIST_ID']
Renames a watchlist, using module:caplin/alerts/testing/WatchlistStub#propertyChanged, e.g.:
when("watchlistservice.watchlistRename['12345'] => 'a new name'");
subjectsAddedToWatchlistRejected['WATCHLIST_ID']
Rejects a request to add subjects to a given watchlist, e.g.:
when("watchlistservice.subjectsAddedToWatchlistRejected['12345'] => '/FX/GBPUSD,/FX/USDJPY|2'");
subjectsRemovedFromWatchlistRejected['WATCHLIST_ID']
Rejects a request to remove subjects from a given watchlist, e.g.:
when("watchlistservice.subjectsRemovedFromWatchlistRejected['12345'] => '/FX/GBPUSD,/FX/USDJPY'");
watchlistRenameRejected['WATCHLIST_ID']
Rejects a request to rename a given watchlist, e.g.:
when("watchlistservice.watchlistRenameRejected['12345'] => 'a new name'");

Constructor

new module:caplin/watchlist/testing/WatchlistFixture()

Implements:

Methods

addSubFixtures()

Implements:

canHandleExactMatch()

Implements:
  • module:br/test/Fixture#canHandleExactMatch

canHandleProperty()

Implements:

doGiven()

Implements:

doThen()

Implements:

doWhen()

Implements:

setUp()

Implements:

tearDown()

Implements: