Advertisement
anechka_ne_plach

Untitled

Oct 29th, 2021
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. #include <string>
  2. #include <vector>
  3.  
  4. class AbstractTest {
  5. public:
  6.     virtual void SetUp() = 0;
  7.     virtual void TearDown() = 0;
  8.     virtual void Run() = 0;
  9.     virtual ~AbstractTest() {
  10.     }
  11. };
  12.  
  13. class TestRegistry {
  14. public:
  15.     template <class TestClass>
  16.     void RegisterClass(const std::string& class_name) {
  17.  
  18.     }
  19.  
  20.     std::unique_ptr<AbstractTest> CreateTest(const std::string& class_name) {
  21.     }
  22.  
  23.     void RunTest(const std::string& test_name) {
  24.     }
  25.  
  26.     template <class Predicate>
  27.     std::vector<std::string> ShowTests(Predicate callback) const {
  28.     }
  29.  
  30.     std::vector<std::string> ShowAllTests() const {
  31.     }
  32.  
  33.     template <class Predicate>
  34.     void RunTests(Predicate callback) {
  35.     }
  36.  
  37.     void Clear() {
  38.     }
  39.  
  40.     static TestRegistry& Instance() {
  41.         return *this;
  42.     }
  43.  
  44.     TestRegistry(const TestRegistry&) = delete;
  45.     TestRegistry(TestRegistry&&) = delete;
  46.     TestRegistry& operator=(const TestRegistry&) = delete;
  47.     TestRegistry& operator=(TestRegistry&&) = delete;
  48.  
  49. private:
  50.     TestRegistry() {
  51.     }
  52.     static std::vector<std::string> registry;
  53.    
  54. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement