Ejemplo n.º 1
0
        public async Task WriteAllAndReadAsync_Async()
        {
            using (var call = UnitTest1.Client.DuplexStreaming())
            {
                IList <TestResponse> responses = await call.WriteAllAndReadAsync(UnitTest1.GetRequestsAsync(3)).ConfigureAwait(false);

                Assert.AreEqual(6, responses.Count);
            }
        }
        public async Task WriteRequestsAsync()
        {
            using (var call = UnitTest1.Client.ClientStreaming())
            {
                await call.WriteRequestsAsync(UnitTest1.GetRequests(3)).ConfigureAwait(false);

                await call.WriteRequestsAsync(UnitTest1.GetRequestsAsync(3)).ConfigureAwait(false);

                await call.WriteRequestsAndCompleteAsync(UnitTest1.GetRequests(3)).ConfigureAwait(false);

                TestResponse response = await call.ResponseAsync.ConfigureAwait(false);

                Assert.AreEqual(18, response.IntValue);
            }
        }