public void RegisteredServiceCanBeAccessedWithGetService() { var hostFactory = (IsolatedAppDomainHostFactory)RuntimeAccessor.ServiceLocator.ResolveByComponentId(IsolatedAppDomainHostFactory.ComponentId); using (IHost host = hostFactory.CreateHost(new HostSetup(), new MarkupStreamLogger(TestLog.Default))) { HostAssemblyResolverHook.InstallCallback(host); host.GetHostService().Do<object, object>(RemoteCallback, null); using (BinaryIpcClientChannel clientChannel = new BinaryIpcClientChannel(PortName)) { TestService serviceProxy = (TestService)clientChannel.GetService(typeof(TestService), ServiceName); Assert.AreEqual(42, serviceProxy.Add(23, 19)); } } }
public void GetServiceThrowsIfServiceNameIsNull() { using (BinaryIpcClientChannel channel = new BinaryIpcClientChannel("port")) channel.GetService(typeof(int), null); }
public void GetServiceThrowsIfServiceTypeIsNull() { using (BinaryIpcClientChannel channel = new BinaryIpcClientChannel("port")) channel.GetService(null, "service"); }