Interface IFileTestBuilder
Used for testing Microsoft.AspNetCore.Mvc.FileResult, Microsoft.AspNetCore.Mvc.FileContentResult, Microsoft.AspNetCore.Mvc.FileStreamResult or Microsoft.AspNetCore.Mvc.VirtualFileResult.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File
Assembly:MyTested.AspNetCore.Mvc.Controllers.dll
Syntax
public interface IFileTestBuilder : IBaseTestBuilderWithActionResult<FileResult>, IBaseTestBuilderWithInvokedAction, IBaseTestBuilderWithAction, IBaseTestBuilderWithComponent, IBaseTestBuilder
Methods
| Improve this Doc View SourceWithContents(Byte[])
Tests whether Microsoft.AspNetCore.Mvc.FileContentResult has the same file contents as the provided byte array.
Declaration
IAndFileTestBuilder WithContents(byte[] fileContents)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | fileContents | File contents as byte array. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |
WithContentType(MediaTypeHeaderValue)
Tests whether Microsoft.AspNetCore.Mvc.FileResult, Microsoft.AspNetCore.Mvc.FileContentResult or Microsoft.AspNetCore.Mvc.FileStreamResult has the same content type as the provided one.
Declaration
IAndFileTestBuilder WithContentType(MediaTypeHeaderValue contentType)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Net.Http.Headers.MediaTypeHeaderValue | contentType | Content type as MediaTypeHeaderValue. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |
WithContentType(String)
Tests whether Microsoft.AspNetCore.Mvc.FileResult, Microsoft.AspNetCore.Mvc.FileContentResult or Microsoft.AspNetCore.Mvc.FileStreamResult has the same content type as the provided one.
Declaration
IAndFileTestBuilder WithContentType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | Content type as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |
WithFileDownloadName(String)
Tests whether Microsoft.AspNetCore.Mvc.FileResult, Microsoft.AspNetCore.Mvc.FileContentResult or Microsoft.AspNetCore.Mvc.FileStreamResult has the same file download name as the provided one.
Declaration
IAndFileTestBuilder WithFileDownloadName(string fileDownloadName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileDownloadName | File download name as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |
WithFileName(String)
Tests whether Microsoft.AspNetCore.Mvc.VirtualFileResult has the same file name as the provided one.
Declaration
IAndFileTestBuilder WithFileName(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | File name as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |
WithFileProvider(IFileProvider)
Tests whether Microsoft.AspNetCore.Mvc.VirtualFileResult has the same file provider as the provided one.
Declaration
IAndFileTestBuilder WithFileProvider(IFileProvider fileProvider)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.FileProviders.IFileProvider | fileProvider | File provider of type IFileProvider. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |
WithFileProviderOfType<TFileProvider>()
Tests whether Microsoft.AspNetCore.Mvc.VirtualFileResult has the same file provider type as the provided one.
Declaration
IAndFileTestBuilder WithFileProviderOfType<TFileProvider>()where TFileProvider : IFileProvider
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |
Type Parameters
Name | Description |
---|---|
TFileProvider | File provider of type IFileProvider. |
WithStream(Stream)
Tests whether Microsoft.AspNetCore.Mvc.FileStreamResult has the same file stream as the provided one.
Declaration
IAndFileTestBuilder WithStream(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | File stream. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.ActionResults.File.IAndFileTestBuilder. |