Files
42_INT_09_piscine_cpp/d05/ex02/main.cpp
2022-03-04 20:58:15 +01:00

85 lines
1.8 KiB
C++

#include "Bureaucrat.hpp"
#include "AForm.hpp"
#include "ShrubberyCreationForm.hpp"
#define N_TEST "5"
int main() {
int i = 0;
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Shrubbery ok :" RESET "\n";
{
Bureaucrat b("natasha", 50);
ShrubberyCreationForm s("sekoia");
std::cout << s << '\n';
std::cout << b << '\n';
std::cout << B_BLUE "b.signForm :" RESET "\n";
b.signForm(s);
b.executeForm(s);
std::cout << s << '\n';
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Shrubbery too low signe and execute :" RESET "\n";
{
Bureaucrat b("jordan", 150);
ShrubberyCreationForm s("chemney");
std::cout << s << '\n';
std::cout << b << '\n';
std::cout << B_BLUE "b.signForm :" RESET "\n";
b.signForm(s);
b.executeForm(s);
std::cout << s << '\n';
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Shrubbery too low execute only :" RESET "\n";
{
Bureaucrat b("bernadette", 140);
ShrubberyCreationForm s("rutabaga");
std::cout << s << '\n';
std::cout << b << '\n';
std::cout << B_BLUE "b.signForm :" RESET "\n";
b.signForm(s);
b.executeForm(s);
std::cout << s << '\n';
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Bureaucrat copy test :" RESET "\n";
{
Bureaucrat b1("pantoufle", 14);
Bureaucrat b2(b1);
std::cout << b1 << "\n";
std::cout << b2 << "\n";
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Shrubbery copy test :" RESET "\n";
{
ShrubberyCreationForm s1("rutabaga");
ShrubberyCreationForm s2(s1);
std::cout << s1 << "\n";
std::cout << s2 << "\n";
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Robotomy :" RESET "\n";
{
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Presidential :" RESET "\n";
{
}
std::cout << "\n";
return 0;
}