public Task Run(TestContext ctx, CancellationToken cancellationToken, [HttpServer] HttpServer server, [ChunkContentType] ChunkContentType type, bool sendAsync) { var runner = new ChunkedTestRunner(server, type, sendAsync); return(runner.Run(ctx, cancellationToken)); }
public Task ServerErrorTests(TestContext ctx, CancellationToken cancellationToken, [HttpServer(ListenerFlags.ExpectException)] HttpServer server, [ChunkContentType(ServerError = true)] ChunkContentType type, bool sendAsync) { var runner = new ChunkedTestRunner(server, type, sendAsync); return(runner.Run(ctx, cancellationToken)); }
public Task ServerErrorTests(TestContext ctx, HttpServer server, bool sendAsync, [ChunkContentType(ServerError = true)] ChunkContentType type, CancellationToken cancellationToken) { var runner = new ChunkedTestRunner(server, type, sendAsync); return(runner.Run(ctx, cancellationToken)); }
static HttpContent ChunkContent(ChunkContentType type) { if (type == ChunkContentType.ServerAbort) { return(new ServerAbortContent()); } else { return(new TestChunkedContent(type)); } }
public ChunkedTestRunner(HttpServer server, ChunkContentType type, bool sendAsync) : base(server, CreateHandler(type), sendAsync) { Type = type; }
public TestChunkedContent(ChunkContentType type) { Type = type; }
public static Handler CreateHandler(ChunkContentType type) { return(new GetHandler(ChunkTypeName(type), ChunkContent(type))); }
static string ChunkTypeName(ChunkContentType type) { return(type.ToString()); }