mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-10-30 06:45:36 +01:00
39 lines
773 B
C++
39 lines
773 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include <mm/engine.hpp>
|
|
#include <mm/services/default_service.hpp>
|
|
|
|
TEST(engine_default_service_system, add_en_dis) {
|
|
|
|
MM::Engine e;
|
|
|
|
e.addService<MM::Services::DefaultService>();
|
|
ASSERT_TRUE(e.enableService<MM::Services::DefaultService>());
|
|
|
|
{
|
|
auto* dss = e.tryService<MM::Services::DefaultService>();
|
|
ASSERT_NE(dss, nullptr);
|
|
}
|
|
|
|
e.disableService<MM::Services::DefaultService>();
|
|
}
|
|
|
|
TEST(engine_default_service_system, tick) {
|
|
|
|
MM::Engine e;
|
|
|
|
e.addService<MM::Services::DefaultService>();
|
|
ASSERT_TRUE(e.enableService<MM::Services::DefaultService>());
|
|
|
|
e.update();
|
|
e.fixedUpdate();
|
|
|
|
{
|
|
auto* dss = e.tryService<MM::Services::DefaultService>();
|
|
ASSERT_NE(dss, nullptr);
|
|
}
|
|
|
|
e.disableService<MM::Services::DefaultService>();
|
|
}
|
|
|