diff options
Diffstat (limited to 'Swift/Controllers/UnitTest/MockMainWindowFactory.h')
-rw-r--r-- | Swift/Controllers/UnitTest/MockMainWindowFactory.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Swift/Controllers/UnitTest/MockMainWindowFactory.h b/Swift/Controllers/UnitTest/MockMainWindowFactory.h new file mode 100644 index 0000000..c67df72 --- /dev/null +++ b/Swift/Controllers/UnitTest/MockMainWindowFactory.h @@ -0,0 +1,22 @@ +#pragma once + +#include "Swift/Controllers/MainWindowFactory.h" +#include "Swiften/Roster/TreeWidgetFactory.h" +#include "Swift/Controllers/UnitTest/MockMainWindow.h" + +namespace Swift { + + class MockMainWindowFactory : public MainWindowFactory { + public: + MockMainWindowFactory(TreeWidgetFactory* treeWidgetFactory) {factory_ = treeWidgetFactory;}; + virtual ~MockMainWindowFactory() {}; + /** + * Transfers ownership of result. + */ + virtual MainWindow* createMainWindow() {return new MockMainWindow(factory_->createTreeWidget());}; + private: + TreeWidgetFactory* factory_; + }; +} + + |