コード例 #1
0
        public void GetDefaultWCFClientProxy_RequestingProxyClientGeneration_Succeeds()
        {
            var proxy = CustomClientProxyFactory.GetDefaultWcfClientInterfaceProxy <ITestService>("TestService");

            var result = proxy.SayHello();

            Assert.IsNotNullOrEmpty(result, "The result was null or empty.");
        }
コード例 #2
0
        public void GetDefaultErrorLoggingClassProxy_RequestProxyClientGenerationAndInvocation_Succeeds()
        {
            var loggerTeststub = new LoggerTestExposal();

            var proxy =
                CustomClientProxyFactory.GetDefaultErrorLoggingInterfaceProxy(
                    CustomClientProxyFactory.GetDefaultWcfClientInterfaceProxy <ITestService>("TestService"),
                    loggerTeststub);

            // Act
            Assert.Throws <TargetInvocationException>(proxy.MethodThatThrowsAnException);

            Assert.IsNotNullOrEmpty(loggerTeststub.LoggedMessage);
        }