> I could add functions to wrap each notifier.* method with flush() call, but
> wasn't sure the test readability would be enhanced. Second opinion desired.
Well, I'd be tempted by a bit more a restructuring of the tests:
All the tests start with:
WindowModelNotifier notifier;
WindowModel model(¬ifier, nullptr); // no need for controller in this testcase
I don't see why these can't be moved into the fixture.
> I could add functions to wrap each notifier.* method with flush() call, but
> wasn't sure the test readability would be enhanced. Second opinion desired.
Well, I'd be tempted by a bit more a restructuring of the tests:
All the tests start with:
WindowModel Notifier notifier;
WindowModel model(¬ifier, nullptr); // no need for controller in this testcase
I don't see why these can't be moved into the fixture.
Then the fixture can have:
void processEvents( std::function< void>(WindowMod elNotifier& notifier) const& eventSource)
eventSource( notifier) ;
qtApp- >sendPostedEven ts();
{
}
and the tests can have:
processEven ts([&]( WindowModelNoti fier& notifier)
notifier. addWindow( mirWindowInfo1) ;
notifier. addWindow( mirWindowInfo2) ;
{
});