public void WriteAsync() { byte[] bytes = Encoding.ASCII.GetBytes("Some random string"); _mockStream.Setup(s => s.WriteAsync(bytes, 0, bytes.Length, It.IsAny <CancellationToken>())) .Returns(Task.FromResult(true)); _mockStream.Setup(s => s.FlushAsync(It.IsAny <CancellationToken>())).Returns(Task.FromResult(true)); _pipe.WriteAsync(bytes); _mockStream.VerifyAll(); }
/// <inheritdoc /> public Task WriteAsync(byte[] bytes, CancellationToken cancellationToken = default(CancellationToken)) => _pipe.WriteAsync(bytes, cancellationToken);