Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 static HttpContent ChunkContent(ChunkContentType type)
 {
     if (type == ChunkContentType.ServerAbort)
     {
         return(new ServerAbortContent());
     }
     else
     {
         return(new TestChunkedContent(type));
     }
 }
Exemplo n.º 5
0
 public ChunkedTestRunner(HttpServer server, ChunkContentType type, bool sendAsync)
     : base(server, CreateHandler(type), sendAsync)
 {
     Type = type;
 }
Exemplo n.º 6
0
 public TestChunkedContent(ChunkContentType type)
 {
     Type = type;
 }
Exemplo n.º 7
0
 public static Handler CreateHandler(ChunkContentType type)
 {
     return(new GetHandler(ChunkTypeName(type), ChunkContent(type)));
 }
Exemplo n.º 8
0
 static string ChunkTypeName(ChunkContentType type)
 {
     return(type.ToString());
 }