2024-08-05 14:32:18 +00:00
|
|
|
//test file for class Services
|
|
|
|
|
|
|
|
#include "Services.h"
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
Services aServices = Services("testSample.csv");
|
|
|
|
vector <Service> result = aServices.getServices();
|
|
|
|
|
|
|
|
vector <Service> expectedResult;
|
|
|
|
list <string> s1={"server1","server1bis"};
|
|
|
|
list <string> s3={"server3"};
|
2024-08-05 16:06:54 +00:00
|
|
|
list <string> s4;
|
|
|
|
list <string> s5;
|
|
|
|
list <string> s6;
|
|
|
|
list <string> s7;
|
|
|
|
|
2024-08-05 14:32:18 +00:00
|
|
|
expectedResult.push_back(Service(1,"username1",s1));
|
|
|
|
expectedResult.push_back(Service(3,"username3",s3));
|
|
|
|
expectedResult.push_back(Service(4,"username4",s4));
|
|
|
|
expectedResult.push_back(Service(5,"username5",s5));
|
2024-08-06 10:37:15 +00:00
|
|
|
expectedResult.push_back(Service(6,"",s6));
|
2024-08-05 14:32:18 +00:00
|
|
|
expectedResult.push_back(Service(7,"username7",s7));
|
|
|
|
|
|
|
|
if(expectedResult==result){
|
|
|
|
cout << "Services test: OK" << endl;
|
|
|
|
return 0;
|
|
|
|
}else {
|
|
|
|
cout << "Services test: FAIL" << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|