Interface IModelErrorDetailsTestBuilder
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 : IBaseTestBuilderWithComponent, IBaseTestBuilder
Methods
| Improve this Doc View SourceAndAlso()
AndAlso method for better readability when chaining error message tests.
Declaration
IModelErrorTestBuilder AndAlso()
Returns
Type | Description |
---|---|
IModelErrorTestBuilder | Test builder of IModelErrorTestBuilder type. |
BeginningWith(String)
Tests whether the error message begins with given message.
Declaration
IAndModelErrorTestBuilder 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 | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder. |
Containing(String)
Tests whether the error message contains given message.
Declaration
IAndModelErrorTestBuilder 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 | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder. |
ContainingError(String)
Tests whether the tested ModelStateDictionary contains error by key.
Declaration
IModelErrorDetailsTestBuilder ContainingError(string errorKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorKey | Error key to search for. |
Returns
Type | Description |
---|---|
IModelErrorDetailsTestBuilder | The same IModelErrorDetailsTestBuilder. |
EndingWith(String)
Tests whether the error message ends with given message.
Declaration
IAndModelErrorTestBuilder 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 | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder. |
ThatEquals(String)
Tests whether the error message is equal to given message.
Declaration
IAndModelErrorTestBuilder ThatEquals(string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorMessage | Expected error message. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Models.IAndModelErrorTestBuilder. |