Gittyup/test/main_window.cpp

49 lines
827 B
C++
Raw Normal View History

2018-12-13 02:22:04 +03:00
//
// Copyright (c) 2016, Scientific Toolworks, Inc.
//
// This software is licensed under the MIT License. The LICENSE.md file
// describes the conditions under which this software may be distributed.
//
// Author: Jason Haslam
//
#include "Test.h"
#include "ui/MainWindow.h"
using namespace Test;
using namespace QTest;
class TestMainWindow : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void show();
void cleanupTestCase();
private:
ScratchRepository mRepo;
MainWindow *mWindow = nullptr;
};
void TestMainWindow::initTestCase()
{
mWindow = new MainWindow(mRepo);
}
void TestMainWindow::show()
{
mWindow->show();
QVERIFY(qWaitForWindowActive(mWindow));
}
void TestMainWindow::cleanupTestCase()
{
mWindow->close();
}
TEST_MAIN(TestMainWindow)
#include "main_window.moc"