Пример #1
0
        public void BuildProxyType_WhenCalled_ImplementsInterfaceAndSubclassesProxyChannel()
        {
            WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(ProxyChannel <IService>));
            Type t = builder.BuildProxyType();

            Assert.IsNotNull(t);
            Assert.IsTrue(t.IsSubclassOf(typeof(ProxyChannel <IService>)));
            Assert.IsNotNull(t.GetInterface("IService", true));
        }
Пример #2
0
        public void Proxy_WhenCallingMethodThatReturnsNull_DoesNotThrowException()
        {
            WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(ProxyChannel <IService>));

            Type            t = builder.BuildProxyType();
            ConstructorInfo constructorInfo = t.GetConstructors()[0];

            ProxyChannel <IService> channel = (ProxyChannel <IService>)constructorInfo.Invoke(null);

            channel.ChannelManager = new StubChannelManager();
            ((IService)channel).ReturnComplexObject();
        }