-
Notifications
You must be signed in to change notification settings - Fork 0
/
TESTTIME.CPP
38 lines (31 loc) · 983 Bytes
/
TESTTIME.CPP
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
/**
* @file TimeTEST.CPP
* @author Lim Wen Chao
* @brief Unit test for Time
* @version 0.1
* @date 2022-02-24
*
*
*/
#include "TIME.H"
#include <iostream>
using namespace std;
int testtime_main ()
{
//Check constructor correctly initializes the data and all getters are able to retrieve the data
Time testTime1;
cout << "Default Constructor" << endl;
cout << "Hour: " << testTime1.GetHour() << endl;
cout << "Minute: " << testTime1.GetMinute() << endl << endl;
Time testTime2(1,1);
cout << "Constructor" << endl;
cout << "Hour: " << testTime2.GetHour() << endl;
cout << "Minute: " << testTime2.GetMinute() << endl << endl;
//Check that setters are working correctly
testTime2.SetHour(3);
testTime2.SetMinute(3);
cout << "Test Setters" << endl;
cout << "Hour: " << testTime2.GetHour() << endl;
cout << "Minute: " << testTime2.GetMinute() << endl << endl;
return 0;
}