aboutsummaryrefslogtreecommitdiff
path: root/src/test/ScriptTest.h
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-06 10:44:42 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-12-06 10:44:42 +0100
commitd5f63024ebed7df2fff8e016bd1c7c26f8fdfa27 (patch)
treeb26e35cb0482d04a33cc96d97ba21c21d0012229 /src/test/ScriptTest.h
parent9cde6875186b335c75eafa6402f0957cd4252c76 (diff)
parent1f4e961d7f9d6887c807cac1a362f2d178b0860b (diff)
Merge branch 'master' into decoupling
Diffstat (limited to 'src/test/ScriptTest.h')
-rw-r--r--src/test/ScriptTest.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ScriptTest.h b/src/test/ScriptTest.h
new file mode 100644
index 0000000..1bbfdd3
--- /dev/null
+++ b/src/test/ScriptTest.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <crepe/api/BehaviorScript.h>
+#include <crepe/api/Script.h>
+#include <crepe/manager/ComponentManager.h>
+#include <crepe/system/ScriptSystem.h>
+
+class ScriptTest : public testing::Test {
+protected:
+ crepe::Mediator mediator;
+
+public:
+ crepe::ComponentManager component_manager{mediator};
+ crepe::ScriptSystem system{mediator};
+
+ class MyScript : public crepe::Script {
+ // NOTE: explicitly stating `public:` is not required on actual scripts
+
+ public:
+ MOCK_METHOD(void, init, (), (override));
+ MOCK_METHOD(void, update, (), (override));
+ };
+
+ crepe::OptionalRef<crepe::BehaviorScript> behaviorscript;
+ crepe::OptionalRef<MyScript> script;
+
+ virtual void SetUp();
+};