Ejemplo n.º 1
0
        public void Overrides_Proxy_Override()
        {
            ProxyFactory factory  = new ProxyFactory();
            MyService2   service2 = new MyService2();

            factory.AddProxyOverride <IMyService, MyService2>(service2);

            var proxy = factory.Proxy <IMyService>();

            Assert.AreEqual("hello", proxy.TestMe("hi"));
        }
Ejemplo n.º 2
0
        public void Overrides_Override()
        {
            ProxyFactory factory  = new ProxyFactory();
            MyService2   service2 = new MyService2();

            factory.AddProxyOverride <IMyService, MyService2>(service2);

            factory.Call <IMyService>(proxy =>
            {
                Assert.AreEqual("hello", proxy.TestMe("hi"));
            });
        }