Here is how the background steps could be implemented by writing a Qt Test: these steps can be run in the init() private slot. As you might remember, in a Qt Test harness, all private slots are tests, and the init() slot gets invoked by the test harness before the execution of each test, and is thus very suitable for implementing the execution of any background steps:
// tst_uc_broadcaster_publishes_sensor_readings.cpp...void Uc_broadcaster_publishes_sensor_readings::init(){ // Given there is a broadcaster // And there is a sensor // And the broadcaster connects to the sensor}
First, we need to create a Broadcaster instance and a Sensor instance. Both will be entities. Since these will need to be accessed ...