2
* Copyright 2013 Canonical Ltd.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of version 3 of the GNU Lesser General Public
6
* License as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public
14
* License along with this library; if not, write to the
15
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
* Boston, MA 02110-1301, USA.
19
#ifndef TEST_FINAL_STATE_H
20
#define TEST_FINAL_STATE_H
24
#include <QStateMachine>
25
#include <QSignalTransition>
26
#include <downloads/state_machines/final_state.h>
27
#include "base_testcase.h"
28
#include "test_runner.h"
31
using namespace Ubuntu::DownloadManager::StateMachines;
33
class TestFinalStateHelperObject : public QObject {
35
Q_PROPERTY(QString name READ name WRITE setName)
36
Q_PROPERTY(QString surname READ surname WRITE setSurname)
39
explicit TestFinalStateHelperObject(QObject* parent=0)
45
TestFinalStateHelperObject(QString name,
57
void setName(QString name) {
65
void setSurname(QString surname) {
69
void emitMoveStates() {
78
QString _surname = "";
81
class TestFinalState : public BaseTestCase {
84
explicit TestFinalState(QObject *parent = 0);
86
private slots: // NOLINT(whitespace/indent)
89
void cleanup() override;
90
void testSetNotProperties();
91
void testSetSingleProperty();
92
void testMultipleProperties();
95
QString _originalName;
96
QString _originalSurname;
97
TestFinalStateHelperObject* _obj;
98
QStateMachine _stateMachine;
101
QSignalTransition* _transition;
104
DECLARE_TEST(TestFinalState)
106
#endif // TEST_FINAL_STATE_H