aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/testing/TestScript.hpp
blob: fdf23a591b8e90761e75910eac3314ac42f25338 (plain) (blame)
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
39
40
41
#pragma once
#include <vector>

#include "openvic-simulation/GameManager.hpp"
#include "openvic-simulation/testing/Requirement.hpp"

namespace OpenVic {

   class TestScript {

      std::vector<Requirement*> requirements = std::vector<Requirement*>();
      GameManager* PROPERTY_RW(game_manager);
      std::string PROPERTY(script_name);

   public:
      TestScript(std::string_view new_script_name);

      // expects an overriden method that performs arbitrary code execution
      // so that each script uniquely performs tests
      // for both requirement adding to script and to execute code
      virtual void add_requirements() = 0;
      virtual void execute_script() = 0;

      // Getters
      std::vector<Requirement*> get_requirements();
      Requirement* get_requirement_at_index(int index);
      Requirement* get_requirement_by_id(std::string id);
      std::vector<Requirement*> get_passed_requirements();
      std::vector<Requirement*> get_failed_requirements();
      std::vector<Requirement*> get_untested_requirements();

      // Setters
      void set_requirements(std::vector<Requirement*> in_requirements);
      void add_requirement(Requirement* req);

      // Methods
      void pass_or_fail_req_with_actual_and_target_values(
         std::string req_name, std::string target_value, std::string actual_value
      );
   };
}