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)); }
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); }