ACF
$AcfVersion:0$
Acf
Include
istd
Test
CChangeDelegatorTest.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2
#pragma once
3
4
5
// Qt includes
6
#include <QtCore/QObject>
7
#include <QtTest/QtTest>
8
9
// ACF includes
10
#include <
istd/CChangeDelegator.h
>
11
#include <
istd/IChangeable.h
>
12
#include <
itest/CStandardTestExecutor.h
>
13
14
// Mock changeable class for testing
15
class
MockChangeable
:
public
istd::IChangeable
16
{
17
public
:
18
int
beginChangesCount
= 0;
19
int
endChangesCount
= 0;
20
istd::IChangeable::ChangeSet
lastChangeSet
;
21
22
virtual
void
OnBeginChanges
()
override
23
{
24
beginChangesCount
++;
25
}
26
27
virtual
void
OnEndChanges
(
const
ChangeSet
& changeSet)
override
28
{
29
endChangesCount
++;
30
lastChangeSet
= changeSet;
31
}
32
};
33
34
class
CChangeDelegatorTest
:
public
QObject
35
{
36
Q_OBJECT
37
private
slots:
38
void
initTestCase();
39
40
void
DefaultConstructorTest();
41
void
ConstructorWithSlaveTest();
42
void
SetGetSlavePtrTest();
43
void
DelegateBeginChangesTest();
44
void
DelegateEndChangesTest();
45
46
void
cleanupTestCase();
47
};
48
49
CChangeDelegator.h
CStandardTestExecutor.h
IChangeable.h
CChangeDelegatorTest
Definition
CChangeDelegatorTest.h:35
MockChangeable
Definition
CChangeDelegatorTest.h:16
MockChangeable::OnBeginChanges
virtual void OnBeginChanges() override
Callback function for begin change event.
Definition
CChangeDelegatorTest.h:22
MockChangeable::beginChangesCount
int beginChangesCount
Definition
CChangeDelegatorTest.h:18
MockChangeable::endChangesCount
int endChangesCount
Definition
CChangeDelegatorTest.h:19
MockChangeable::OnEndChanges
virtual void OnEndChanges(const ChangeSet &changeSet) override
Callback function for end change event.
Definition
CChangeDelegatorTest.h:27
MockChangeable::lastChangeSet
istd::IChangeable::ChangeSet lastChangeSet
Definition
CChangeDelegatorTest.h:20
istd::IChangeable::ChangeSet
Set of change flags (its IDs).
Definition
IChangeable.h:36
istd::IChangeable
Common interface for data model objects, which can be changed.
Definition
IChangeable.h:28
Generated by
1.9.8