Constructor
new module:caplin/watchlist/testing/WatchlistServiceStub()
- Implements:
- caplin/watchlist/WatchlistService
Methods
-
addWatchlist(properties) → {module:caplin/watchlist/Watchlist}
-
A stub method used for adding watchlists without having to respond to a request for creation. This can be used to simulate watchlists being created on a different device.
Parameters:
Name Type Description properties
map The properties of the watchlist being added. Returns:
The added watchlist. -
create(name, error, success)
-
Fires a CREATE_REQUESTED event (see
module:caplin/watchlist/testing/WatchlistServiceStubEvents
) if the service status is AVAILABLE, or fires the error callback otherwise.Parameters:
Name Type Description name
String The name of the watchlist to be created. error
function A callback that will be invoked if the request fails. success
function A callback that will be invoked when the request succeeds. -
dispose(watchlists, error, success)
-
Fires a DISPOSE_REQUESTED event (see
module:caplin/watchlist/testing/WatchlistServiceStubEvents
) if the service status is AVAILABLE, or fires the error callback otherwise.Parameters:
Name Type Description watchlists
Array.<module:caplin/watchlist/Watchlist> The watchlists to dispose of. error
function A callback that will be invoked if the request fails. success
function A callback that will be invoked when the request succeeds. -
getById()
-
-
getContentsManager()
-
getId()
-
getName()
-
getSubject()
-
getWatchlistCount()
-
-
getWatchlists()
-
-
propertyChanged(name, value)
-
Stub method to change the value of one of this watchlist's properties.
Parameters:
Name Type Description name
The name of the property to change. value
The new value for the changed property. -
removeWatchlist(watchlist)
-
A stub method used for removing watchlists without having to respond to a request for disposal. This can be used to simulate watchlists being removed on a different device.
Parameters:
Name Type Description watchlist
module:caplin/watchlist/Watchlist The removed watchlist. -
setName()
-
setStatus(status)
-
A stub method used to set the status of the service, representing the availability of its data
Parameters:
Name Type Description status
module:caplin/services/ServiceStatus The new status of the service. -
subjectsAdded(subjects)
-
Stub method to add subjects to this watchlist.
Parameters:
Name Type Description subjects
array The subjects to add to this watchlist. -
subjectsRemoved(subjects)
-
Stub method to remove subjects from this watchlist.
Parameters:
Name Type Description subjects
array The subjects to remove from this watchlist.