-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_acl_base.cpp
More file actions
56 lines (42 loc) · 1.08 KB
/
Copy pathtest_acl_base.cpp
File metadata and controls
56 lines (42 loc) · 1.08 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
#include "test_acl_base.h"
test_acl_base::test_acl_base(QObject *parent) : QObject(parent)
{
}
void test_acl_base::initTestCase()
{
qDebug("Called before everything else.");
}
void test_acl_base::init()
{
qDebug("Called before every test");
}
void test_acl_base::setUserName()
{
acl_base *temp = new acl_base("Piotr");
QCOMPARE(temp->getUserName(), "Piotr");
}
void test_acl_base::getAccessLevel_data()
{
QTest::addColumn<QString>("user1");
QTest::addColumn<QString>("result");
QTest::newRow("First") << "First"<< "Forbidden";
QTest::newRow("Second") << "Second"<< "Forbidden";
QTest::newRow("Third") << "Third"<< "Forbidden";
}
void test_acl_base::getAccessLevel()
{
acl_base temp;
temp.setUserName("Piotr");
temp.addProcessList({"First", "Second", "Third"});
QFETCH(QString, user1);
QFETCH(QString, result);
QCOMPARE(temp.getAccessLevel(user1), result);
}
void test_acl_base::cleanup()
{
qDebug("Called after any test");
}
void test_acl_base::cleanupTestCase()
{
qDebug("Called after myFirstTest and mySecondTest.");
}