Exemplo n.º 1
0
        public void ExecuteAsync_ThrowsDirectoryNotFound_IfItCanNotFindTheDirectory_ForRootPaths(string path)
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            BasePhysicalFileResultTest
            .ExecuteAsync_ThrowsDirectoryNotFound_IfItCanNotFindTheDirectory_ForRootPaths(path, action);
        }
Exemplo n.º 2
0
        public void ExecuteAsync_ThrowsFileNotFound_WhenFileDoesNotExist_ForRootPaths(string path)
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            BasePhysicalFileResultTest
            .ExecuteAsync_ThrowsFileNotFound_WhenFileDoesNotExist_ForRootPaths(path, action);
        }
Exemplo n.º 3
0
        public async Task WriteFileAsync_WritesRangeRequested(long?start, long?end, string expectedString, long contentLength)
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_WritesRangeRequested(
                start,
                end,
                expectedString,
                contentLength,
                action);
        }
Exemplo n.º 4
0
        public async Task ExecuteResultAsync_CallsSendFileAsync_IfIHttpSendFilePresent()
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.ExecuteResultAsync_CallsSendFileAsync_IfIHttpSendFilePresent(action);
        }
Exemplo n.º 5
0
        public async Task WriteFileAsync_RangeRequested_NotModified()
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_RangeRequested_NotModified(action);
        }
Exemplo n.º 6
0
        public async Task WriteFileAsync_RangeRequestedNotSatisfiable(string rangeString)
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_RangeRequestedNotSatisfiable(rangeString, action);
        }
Exemplo n.º 7
0
        public async Task WriteFileAsync_RangeHeaderMalformed_RangeRequestIgnored(string rangeString)
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_RangeHeaderMalformed_RangeRequestIgnored(rangeString, action);
        }
Exemplo n.º 8
0
        public async Task WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored()
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_IfRangeHeaderInvalid_RangeRequestedIgnored(action);
        }
Exemplo n.º 9
0
        public async Task ExecuteResultAsync_WorksWithAbsolutePaths()
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.ExecuteResultAsync_WorksWithAbsolutePaths(action);
        }
Exemplo n.º 10
0
        public async Task ExecuteAsync_ThrowsNotSupported_ForNonRootedPaths(string path)
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.ExecuteAsync_ThrowsNotSupported_ForNonRootedPaths(path, action);
        }
Exemplo n.º 11
0
        public async Task ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding()
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.ExecuteResultAsync_SetsSuppliedContentTypeAndEncoding(action);
        }
Exemplo n.º 12
0
        public async Task ExecuteResultAsync_CallsSendFileAsyncWithRequestedRange_IfIHttpSendFilePresent(long?start, long?end, long contentLength)
        {
            var action = new Func <PhysicalFileResult, HttpContext, Task>(async(result, context) => await((IResult)result).ExecuteAsync(context));

            await BasePhysicalFileResultTest.ExecuteResultAsync_CallsSendFileAsyncWithRequestedRange_IfIHttpSendFilePresent(start, end, contentLength, action);
        }
Exemplo n.º 13
0
        public async Task WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored()
        {
            var action = new Func <PhysicalFileResult, ActionContext, Task>(async(result, context) => await result.ExecuteResultAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_RangeProcessingNotEnabled_RangeRequestedIgnored(action);
        }
Exemplo n.º 14
0
        public async Task WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange()
        {
            var action = new Func <PhysicalFileResult, ActionContext, Task>(async(result, context) => await result.ExecuteResultAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_IfRangeHeaderValid_WritesRequestedRange(action);
        }
Exemplo n.º 15
0
        public async Task WriteFileAsync_RangeRequested_PreconditionFailed()
        {
            var action = new Func <PhysicalFileResult, ActionContext, Task>(async(result, context) => await result.ExecuteResultAsync(context));

            await BasePhysicalFileResultTest.WriteFileAsync_RangeRequested_PreconditionFailed(action);
        }