C# Class FluentAssertions.Mvc.ContentResultAssertions

Contains a number of methods to assert that a ContentResult is in the expected state.
Inheritance: ObjectAssertions
Show file Open project: kevinkuszyk/FluentAssertions.MVC

Public Methods

Method Description
ContentResultAssertions ( ContentResult subject ) : FluentAssertions.Execution

Initializes a new instance of the T:ContentResultAssertions class.

WithContent ( string expectedContent, string reason = "" ) : ContentResultAssertions

Asserts that the content is exactly the same as the expected content, ignoring the casing.

WithContentEncoding ( Encoding expectedEncoding, string reason = "" ) : ContentResultAssertions

Asserts that the content encoding is the expected content encoding type.

WithContentType ( string expectedContentType, string reason = "" ) : ContentResultAssertions

Asserts that the content type is the expected content type.

Method Details

ContentResultAssertions() public method

Initializes a new instance of the T:ContentResultAssertions class.
public ContentResultAssertions ( ContentResult subject ) : FluentAssertions.Execution
subject ContentResult
return FluentAssertions.Execution

WithContent() public method

Asserts that the content is exactly the same as the expected content, ignoring the casing.
public WithContent ( string expectedContent, string reason = "" ) : ContentResultAssertions
expectedContent string The expected content string.
reason string /// A formatted phrase as is supported by explaining why the assertion /// is needed. If the phrase does not start with the word because, it is prepended automatically. ///
return ContentResultAssertions

WithContentEncoding() public method

Asserts that the content encoding is the expected content encoding type.
public WithContentEncoding ( Encoding expectedEncoding, string reason = "" ) : ContentResultAssertions
expectedEncoding System.Text.Encoding The expected content encoding type.
reason string /// A formatted phrase as is supported by explaining why the assertion /// is needed. If the phrase does not start with the word because, it is prepended automatically. ///
return ContentResultAssertions

WithContentType() public method

Asserts that the content type is the expected content type.
public WithContentType ( string expectedContentType, string reason = "" ) : ContentResultAssertions
expectedContentType string The expected content type.
reason string /// A formatted phrase as is supported by explaining why the assertion /// is needed. If the phrase does not start with the word because, it is prepended automatically. ///
return ContentResultAssertions