Exemplo n.º 1
0
        public void SslStream_StreamToStream_FlushAsync_Propagated()
        {
            VirtualNetwork network = new VirtualNetwork();

            using (var stream = new VirtualNetworkStream(network, isServer: false))
                using (var sslStream = new SslStream(stream, false, AllowAnyServerCertificate))
                {
                    Task task = sslStream.FlushAsync();

                    Assert.False(task.IsCompleted);
                    stream.CompleteAsyncFlush();
                    Assert.True(task.IsCompleted);
                }
        }
Exemplo n.º 2
0
        public void NegotiateStream_StreamToStream_FlushAsync_Propagated()
        {
            VirtualNetwork network = new VirtualNetwork();

            using (var stream = new VirtualNetworkStream(network, isServer: false))
                using (var negotiateStream = new NegotiateStream(stream))
                {
                    Task task = negotiateStream.FlushAsync();

                    Assert.False(task.IsCompleted);
                    stream.CompleteAsyncFlush();
                    Assert.True(task.IsCompleted);
                }
        }