// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines; using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Testing { public class MockSocketOutput : ISocketOutput { public MockSocketOutput() { } public void Write(ArraySegment buffer, bool chunk = false) { } public Task WriteAsync(ArraySegment buffer, bool chunk = false, CancellationToken cancellationToken = default(CancellationToken)) { return TaskCache.CompletedTask; } public void Flush() { } public Task FlushAsync(CancellationToken cancellationToken = new CancellationToken()) { return TaskCache.CompletedTask; } public void Write(Action write, T state) where T : struct { } } }