| 94 | |
| 95 | |
| 96 | TEST_F(ServiceReferenceTest, TestServiceReferenceAssignmentAndCopy) |
| 97 | { |
| 98 | auto s1 = std::make_shared<TestServiceA>(); |
| 99 | |
| 100 | ServiceRegistrationBase reg1 = context.RegisterService<ServiceNS::ITestServiceA>(s1); |
| 101 | ServiceReferenceBase ref1 = reg1.GetReference(); |
| 102 | |
| 103 | ASSERT_EQ(ref1.GetInterfaceId(), ""); |
| 104 | ServiceReference<ServiceNS::ITestServiceA> typedRefAssign; |
| 105 | ServiceReference<ServiceNS::ITestServiceA> typedRefCopy = ref1; |
| 106 | typedRefAssign = ref1; |
| 107 | ASSERT_EQ(typedRefAssign.GetInterfaceId(), "ServiceNS::ITestServiceA"); |
| 108 | ASSERT_EQ(typedRefCopy.GetInterfaceId(), "ServiceNS::ITestServiceA"); |
| 109 | |
| 110 | reg1.Unregister(); |
| 111 | } |
| 112 | |
| 113 | // This test exercises the 2 ways to register a service |
| 114 | // a. using the name of the interface i.e. "Foo::Bar" |
nothing calls this directly
no test coverage detected