예제 #1
0
        private async Task TestGetStreamFromIntAsync(StreamingService channel, int requestedStreamSize, int bufSize)
        {
            using (var stream = await channel.GetStreamFromIntAsync(requestedStreamSize))
            {
                var receivedStreamSize = await VerifiableStream.VerifyStreamAsync(stream, requestedStreamSize, bufSize, _params.VerifyStreamContent);

                if (receivedStreamSize != requestedStreamSize)
                {
                    VerifiableStream.ReportIncorrectStreamSize(receivedStreamSize, requestedStreamSize);
                }
            }
        }
예제 #2
0
        private static async Task <int> TestGetStreamFromIntAsync(StreamingRequestContext <StreamingService> details)
        {
            details.TestScenario = StreamingScenarios.StreamIn; // update the scenario
            using (var stream = await details.Channel.GetStreamFromIntAsync(details.StreamSize))
            {
                var receivedStreamSize = await VerifiableStream.VerifyStreamAsync(stream, details.StreamSize, details.BufferSize, details.VerifyStreamContent);

                if (receivedStreamSize != details.StreamSize)
                {
                    VerifiableStream.ReportIncorrectStreamSize(receivedStreamSize, details.StreamSize);
                }
            }
            return(1);
        }
예제 #3
0
        private static async Task <int> TestEchoStreamAsync(StreamingRequestContext <StreamingService> details)
        {
            details.TestScenario = StreamingScenarios.StreamEcho;
            using (var stream = new VerifiableStream(details.StreamSize))
            {
                using (var receivedStream = await details.Channel.EchoStreamAsync(stream))
                {
                    var receivedSize = await VerifiableStream.VerifyStreamAsync(receivedStream, details.StreamSize, details.BufferSize, details.VerifyStreamContent);

                    if (receivedSize != details.StreamSize)
                    {
                        VerifiableStream.ReportIncorrectStreamSize(receivedSize, details.StreamSize);
                    }
                }
            }
            return(1);
        }