Interface IModelErrorDetailsTestBuilder<TModel>
Used for testing specific ModelStateDictionary errors.
Inherited Members
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Models
Assembly:MyTested.AspNetCore.Mvc.ModelState.dll
Syntax
public interface IModelErrorDetailsTestBuilder<TModel> : IBaseTestBuilderWithComponent, IBaseTestBuilder
Type Parameters
Name | Description |
---|---|
TModel | Model from invoked action in ASP.NET Core MVC controller. |
Methods
| Improve this Doc View SourceAndAlso()
AndAlso method for better readability when chaining error message tests.
Declaration
IModelErrorTestBuilder<TModel> AndAlso()
Returns
Type | Description |
---|---|
IModelErrorTestBuilder<TModel> | Test builder of IModelErrorTestBuilder<TModel> type. |
BeginningWith(String)
Tests whether the error message begins with given message.
Declaration
IAndModelErrorTestBuilder<TModel> BeginningWith(string beginMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | beginMessage | Expected beginning for the error message. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder<TModel> | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder`1. |
Containing(String)
Tests whether the error message contains given message.
Declaration
IAndModelErrorTestBuilder<TModel> Containing(string containsMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | containsMessage | Expected containing string for the error message. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder<TModel> | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder`1. |
ContainingError(String)
Tests whether the tested ModelStateDictionary contains error by key.
Declaration
IModelErrorDetailsTestBuilder<TModel> ContainingError(string errorKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorKey | Error key to search for. |
Returns
Type | Description |
---|---|
IModelErrorDetailsTestBuilder<TModel> | The same IModelErrorDetailsTestBuilder<TModel>. |
EndingWith(String)
Tests whether the error message ends with given message.
Declaration
IAndModelErrorTestBuilder<TModel> EndingWith(string endMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | endMessage | Expected ending for the error message. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder<TModel> | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder`1. |
ThatEquals(String)
Tests whether the error message is equal to given message.
Declaration
IAndModelErrorTestBuilder<TModel> ThatEquals(string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorMessage | Expected error message. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder<TModel> | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder`1. |