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