Exemple #1
0
        public async Task Test1()
        {
            using (var fixtureData = new TestBasicAuthHttpJsonWcfServiceFixture())
            {
                fixtureData.Init();

                _output.WriteLine((fixtureData.Proxy.TestMethod1()).WriteObjectToJson());
                _output.WriteLine((await fixtureData.Proxy.TestMethod2(
                                       new List <TestServer1Data1>()
                {
                    new TestServer1Data1(),
                    new TestServer1Data1()
                    {
                        Value1 = 150.5m
                    }
                },
                                       10
                                       ).ConfigureAwait(false)
                                   ).WriteObjectToJson());
                _output.WriteLine((await fixtureData.Proxy.TestMethod3(
                                       new List <TestServer1Data1>()
                {
                    new TestServer1Data1(),
                    new TestServer1Data1()
                    {
                        Value1 = 150.5m
                    }
                },
                                       10
                                       ).ConfigureAwait(false)
                                   ).WriteObjectToJson());
                _output.WriteLine("{0}", DateTime.UtcNow);
                await fixtureData.Proxy.TestDelay().ConfigureAwait(false);

                _output.WriteLine("{0}", DateTime.UtcNow);
                await Assert.ThrowsAsync <RpcRethrowableException>(
                    async() => await fixtureData.Proxy.TestRpcExc().ConfigureAwait(false)
                    ).ConfigureAwait(false);

                await Assert.ThrowsAsync <JsonRpcException>(
                    async() => await fixtureData.Proxy.TestJsonExc().ConfigureAwait(false)
                    ).ConfigureAwait(false);
            }
        }
        public async Task Test1()
        {
            using (var fixtureData = new TestBasicAuthHttpJsonWcfServiceFixture())
            {
                fixtureData.Init();

                _output.WriteLine((fixtureData.Proxy.TestMethod1()).WriteObjectToJson());
                _output.WriteLine((await fixtureData.Proxy.TestMethod2(
                    new List<TestServer1Data1>()
                    {
                        new TestServer1Data1(),
                        new TestServer1Data1()
                        {
                            Value1 = 150.5m
                        }
                    },
                    10
                    ).ConfigureAwait(false)
                    ).WriteObjectToJson());
                _output.WriteLine((await fixtureData.Proxy.TestMethod3(
                    new List<TestServer1Data1>()
                    {
                        new TestServer1Data1(),
                        new TestServer1Data1()
                        {
                            Value1 = 150.5m
                        }
                    },
                    10
                    ).ConfigureAwait(false)
                ).WriteObjectToJson());
                _output.WriteLine("{0}", DateTime.UtcNow);
                await fixtureData.Proxy.TestDelay().ConfigureAwait(false);
                _output.WriteLine("{0}", DateTime.UtcNow);
                await Assert.ThrowsAsync<RpcRethrowableException>(
                    async () => await fixtureData.Proxy.TestRpcExc().ConfigureAwait(false)
                ).ConfigureAwait(false);
                await Assert.ThrowsAsync<JsonRpcException>(
                    async () => await fixtureData.Proxy.TestJsonExc().ConfigureAwait(false)
                ).ConfigureAwait(false);
            }
        }