diff options
Diffstat (limited to 'src/test/ResourceManagerTest.cpp')
-rw-r--r-- | src/test/ResourceManagerTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ResourceManagerTest.cpp b/src/test/ResourceManagerTest.cpp index b6be3c0..44a5921 100644 --- a/src/test/ResourceManagerTest.cpp +++ b/src/test/ResourceManagerTest.cpp @@ -17,6 +17,10 @@ class ResourceManagerTest : public Test { public: ResourceManager resource_manager{mediator}; + class Unrelated : public Resource { + using Resource::Resource; + }; + Asset asset_a{"asset/texture/img.png"}; Asset asset_b{"asset/texture/ERROR.png"}; @@ -69,3 +73,9 @@ TEST_F(ResourceManagerTest, Persistent) { resource_manager.clear_all(); EXPECT_EQ(TestResource::instances, 0); } + +TEST_F(ResourceManagerTest, UnmatchedType) { + EXPECT_NO_THROW({ resource_manager.get<TestResource>(asset_a); }); + + EXPECT_THROW({ resource_manager.get<Unrelated>(asset_a); }, runtime_error); +} |