Пример #1
0
        public async Task StructWriteAllAndFillAsync_Async()
        {
            using (var call = UnitTest1.Client.StructDuplexStreaming())
            {
                List <TestResponseStruct> responses = new List <TestResponseStruct>();
                await call.WriteAllAndFillAsync(UnitTest1.GetRequestStructsAsync(3), responses).ConfigureAwait(false);

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

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

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

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

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