cpp/CPP05/ex00/main.cpp
2024-12-04 17:29:31 +01:00

53 lines
1 KiB
C++

#include "Bureaucrat.hpp"
int main() {
std::cout << "\n---Test---\n" << std::endl;
try {
Bureaucrat toto("toto", 151);
}
catch (std::exception & e) {
std::cout << e.what() << std::endl;
}
std::cout << "\n----------------\n" << std::endl;
try {
Bureaucrat toto("toto", 0);
}
catch (std::exception & e) {
std::cout << e.what() << std::endl;
}
std::cout << "\n----------------\n" << std::endl;
try {
Bureaucrat toto("toto", -515);
}
catch (std::exception & e) {
std::cout << e.what() << std::endl;
}
std::cout << "\n----------------\n" << std::endl;
try {
Bureaucrat toto("toto", 5);
std::cout << toto << std::endl;
toto.decreaseGrade();
std::cout << toto << std::endl;
toto.increaseGrade();
toto.increaseGrade();
toto.increaseGrade();
toto.increaseGrade();
toto.increaseGrade();
std::cout << toto << std::endl;
toto.increaseGrade();
std::cout << toto << std::endl;
}
catch (std::exception & e) {
std::cout << e.what() << std::endl;
}
std::cout << "\n---End Test---\n" << std::endl;
}