-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtst_avdejtesttest.cpp
More file actions
99 lines (84 loc) · 1.63 KB
/
Copy pathtst_avdejtesttest.cpp
File metadata and controls
99 lines (84 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include <QtGui>
#include <QtCore/QString>
#include <QtTest/QtTest>
#include <QtCore/QCoreApplication>
#include "../textedit.h"
class
AvdejTestTest : public QObject
{
Q_OBJECT
public:
AvdejTestTest();
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void testCase1();
void testCase2();
void testCase3();
void testCase4();
void testCase5();
void testCase6();
};
AvdejTestTest::AvdejTestTest()
{
}
void
AvdejTestTest::initTestCase()
{
}
void
AvdejTestTest::cleanupTestCase()
{
}
void
AvdejTestTest::testCase1()
{
TextEdit txt;
QCOMPARE(true,txt.fileNew());
}
void
AvdejTestTest::testCase2()
{
TextEdit txt;
QTextEdit mytxt;
QTest::keyClicks(&mytxt, "F1");
QCOMPARE(mytxt.toPlainText(), QString("F1"));
}
void
AvdejTestTest::testCase3()
{
TextEdit txt;
bool success;
int result =txt.textStyle(0);
if (result==0)
success=true;
else success=false;
QCOMPARE(true,success);
}
void
AvdejTestTest::testCase4()
{
//qDebug()<<"You have to open G:/Lab1_tests/textedit/1.jpg";
TextEdit txt;
bool result;
result=txt.fileOpen("G:/Lab1_tests/textedit/1.docx");
QCOMPARE(result,true);
}
void
AvdejTestTest::testCase5()
{
TextEdit txt;
txt.actionEditForTest->activate(QAction::Trigger);
QCOMPARE(txt.textEdit->toPlainText(), QString("F1"));
}
void
AvdejTestTest::testCase6()
{
bool success;
TextEdit txt;
QString str="5555";
success=txt.ForSaveWord(str);
QCOMPARE(success,true);
}
QTEST_MAIN(AvdejTestTest);
#include "tst_AvdejTestTest.moc"