Caplin Trader 5.1.0

Interface: module:ct-alerts/testing/NotificationFixture


The NotificationFixture allows for testing of components that use the module:ct-alerts/NotificationService.

The following actions are supported:

Creates a new notification, using module:ct-alerts/testing/NotificationServiceStub#createNotification. To specify the notification source and timestamp (required), include them in a pipe-separated list, followed by an additional field as follows:
given("notificationservice.createNotification = 'TRIGGERED|1428571428|a:5'");
Passes the notification referred to by the given index to module:ct-alerts/testing/NotificationServiceStub#removeNotification. For example, the following snippet removes the first notification created:
when("notificationservice.removeNotification => 0");
Rejects the last request made to the service to dismiss a notification. It ignores whatever value you provide, but the Verifier framework requires that you pass some value to it.
when("notificationservice.dismissRejected => true");
Sets the status of the notificationservice to the given string, using module:ct-alerts/testing/NotificationServiceStub#setStatus, e.g.
when("notificationservice.status => 'UNAVAILABLE'");