public void Trivial()
        {
            var implementationInfo = new ServiceImplementationInfo();
            var path    = new ServicePath("MyService", "MyMethod");
            var handler = (ServiceMethodHandler)((i, d) => new byte[0]);

            factory.CreateMethodHandler(implementationInfo, path).Returns(handler);

            var handler1 = container.GetMethodHandler(implementationInfo, path);
            var handler2 = container.GetMethodHandler(implementationInfo, path);

            Assert.That(handler1, Is.EqualTo(handler2));
        }
Exemplo n.º 2
0
 public ServiceMethodHandler GetMethodHandler(ServiceImplementationInfo serviceImplementationInfo, ServicePath servicePath)
 {
     return(handlers.GetOrAdd(servicePath, p => factory.CreateMethodHandler(serviceImplementationInfo, p)));
 }