Gittyup/test/main_window.cpp
2018-12-12 16:22:04 -07:00

49 lines
827 B
C++

//
// 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"