21 #include <unity/scopes/Version.h>
23 #include <unity/scopes/testing/MockRegistry.h>
25 #include <gtest/gtest.h>
42 template<
typename Scope>
45 inline static const char* name()
50 inline static std::shared_ptr<Scope> construct()
52 return std::make_shared<Scope>();
56 class TypedScopeFixtureHelper
58 static void set_scope_directory(std::shared_ptr<ScopeBase>
const& scope, std::string
const& path);
59 static void set_cache_directory(std::shared_ptr<ScopeBase>
const& scope, std::string
const& path);
60 static void set_app_directory(std::shared_ptr<ScopeBase>
const& scope, std::string
const& path);
61 static void set_tmp_directory(std::shared_ptr<ScopeBase>
const& scope, std::string
const& path);
62 static void set_registry(std::shared_ptr<ScopeBase>
const& scope,
RegistryProxy const& r);
64 template<
typename Scope>
65 friend class TypedScopeFixture;
76 template<
typename Scope>
83 , scope(ScopeTraits<Scope>::construct())
85 TypedScopeFixtureHelper::set_registry(scope, registry_proxy);
90 ASSERT_NO_THROW(scope->start(ScopeTraits<Scope>::name()));
91 ASSERT_NO_THROW(scope->run());
94 void set_scope_directory(std::string
const& path)
96 TypedScopeFixtureHelper::set_scope_directory(scope, path);
99 void set_cache_directory(std::string
const& path)
101 TypedScopeFixtureHelper::set_cache_directory(scope, path);
104 void set_app_directory(std::string
const& path)
106 TypedScopeFixtureHelper::set_app_directory(scope, path);
109 void set_tmp_directory(std::string
const& path)
111 TypedScopeFixtureHelper::set_tmp_directory(scope, path);
114 static void set_registry(std::shared_ptr<ScopeBase>
const& scope,
RegistryProxy const& r)
116 TypedScopeFixtureHelper::set_registry(scope, r);
121 EXPECT_NO_THROW(scope->stop());
125 unity::scopes::testing::MockRegistry registry;
127 std::shared_ptr<Scope> scope;
Fixture for testing scope testing.
Definition: TypedScopeFixture.h:77
Definition: OnlineAccountClient.h:39
Top-level namespace for all things Unity-related.
Definition: Version.h:49
White pages service for available scopes.
Definition: Registry.h:51
std::shared_ptr< Registry > RegistryProxy
Convenience type definition.
Definition: RegistryProxyFwd.h:33