Exemplo n.º 1
0
        public void ExecuteMethodOnCustomProxyThatIsAlsoInInterface_Throws_Ok()
        {
            ProxyFactory           factory  = new ProxyFactory(typeof(CustomProxy));
            Mock <IClientPipeline> pipeline = new Mock <IClientPipeline>();

            IDummyInterface proxy = factory.CreateProxy <IDummyInterface>(pipeline.Object);

            Assert.Throws <InvalidOperationException>(() => proxy.Execute(true));
        }
Exemplo n.º 2
0
        public void ExecuteMethodOnCustomProxyThatIsAlsoInInterface()
        {
            ProxyFactory           factory  = new ProxyFactory(typeof(CustomProxy));
            Mock <IClientPipeline> pipeline = new Mock <IClientPipeline>();

            IDummyInterface proxy = factory.CreateProxy <IDummyInterface>(pipeline.Object);

            Assert.Equal(10, proxy.Execute(false));
            Assert.True(((CustomProxy)proxy).Executed);
        }