d05 ex02 ok

This commit is contained in:
hugogogo
2022-03-05 15:59:52 +01:00
parent 0a5827f3a1
commit 6c16b9c1d6
11 changed files with 215 additions and 26 deletions

View File

@@ -1,6 +1,8 @@
#include "Bureaucrat.hpp"
#include "AForm.hpp"
#include "ShrubberyCreationForm.hpp"
#include "RobotomyRequestForm.hpp"
#include "PresidentialPardonForm.hpp"
#define N_TEST "5"
@@ -10,7 +12,7 @@ int main() {
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Shrubbery ok :" RESET "\n";
{
Bureaucrat b("natasha", 50);
Bureaucrat b("natasha", 1);
ShrubberyCreationForm s("sekoia");
std::cout << s << '\n';
@@ -22,7 +24,7 @@ int main() {
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Shrubbery too low signe and execute :" RESET "\n";
<< "Shrubbery too low sign and execute :" RESET "\n";
{
Bureaucrat b("jordan", 150);
ShrubberyCreationForm s("chemney");
@@ -72,11 +74,42 @@ int main() {
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Robotomy :" RESET "\n";
{
Bureaucrat b("romeo", 15);
RobotomyRequestForm r("oven");
std::cout << r << '\n';
std::cout << b << '\n';
std::cout << B_BLUE "b.signForm :" RESET "\n";
b.signForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
b.executeForm(r);
std::cout << r << '\n';
}
std::cout << B_YELLOW "\n[" << ++i << "/" N_TEST "] "
<< "Presidential :" RESET "\n";
{
Bureaucrat b("sylvestre", 1);
PresidentialPardonForm p("queen");
std::cout << p << '\n';
std::cout << b << '\n';
std::cout << B_BLUE "b.signForm :" RESET "\n";
b.signForm(p);
b.executeForm(p);
std::cout << p << '\n';
}
std::cout << "\n";