The ConnectionServiceFixture
serves to create a mocking interface for a ConnectionSevice
to enable tests to simulate connection status changes as follows:
given(PM shows connection-down message)
when("connection.statusChanged => ['OK', 'Liberator has connected']")
then(PM no longer shows connection-down message)
The ConnectionServiceFixture
possible values are OK, ERROR or LIMITED
Attributes | Name and Description |
---|---|
|
caplin.services.testing.ConnectionServiceFixture()
Constructs a |
Attributes | Name and Description |
---|---|
|
void
doGiven(String sPropertyName, Variant vValue)
This method enables the fixture to trigger the stub to simulate a connection status change event with the property 'statusChanged' and value set to an array containing the connection status value to be set as the first element and any reasons for the status change as further elements. |
|
void
doThen(String sPropertyName, Variant vValue)
ConnectionServiceFixture does not support any properties with doThen. |
|
void
doWhen(String sPropertyName, Variant vValue)
This method enables the fixture to trigger the stub to simulate a connection status change event with the property 'statusChanged' and value set to the connection status value to be set. |
|
void
setConnectionServiceStub(caplin.services.testing.ConnectionServiceStub oConnectionServiceStub)
Sets the stub to be used as the connection service provider. |
►
caplin.services.testing.ConnectionServiceFixture()
Constructs a caplin.services.testing.ConnectionServiceFixture
.
►
void
doGiven(String sPropertyName, Variant vValue)
This method enables the fixture to trigger the stub to simulate a connection status change event with the property 'statusChanged' and value set to an array containing the connection status value to be set as the first element and any reasons for the status change as further elements. eg ['OK', 'Connected to Liberator', 'All services are available'].
String | sPropertyName | The property name |
Variant | vValue | The value to check. |
►
void
doThen(String sPropertyName, Variant vValue)
ConnectionServiceFixture does not support any properties with doThen.
String | sPropertyName | The property name |
Variant | vValue | The value to set |
►
void
doWhen(String sPropertyName, Variant vValue)
This method enables the fixture to trigger the stub to simulate a connection status change event with the property 'statusChanged' and value set to the connection status value to be set.
String | sPropertyName | The property name |
Variant | vValue | The value to set |
►
void
setConnectionServiceStub(caplin.services.testing.ConnectionServiceStub oConnectionServiceStub)
Sets the stub to be used as the connection service provider.
caplin.services.testing.ConnectionServiceStub | oConnectionServiceStub | the mock connection status provider to simulate connection up/down events. |