MY TESTED ASP.NET CORE MVC DOCS
Show / Hide Table of Contents

Interface IModelErrorDetailsTestBuilder<TModel>

Used for testing specific ModelStateDictionary errors.

Inherited Members
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Action<TComponent>)
IBaseTestBuilderWithComponent.ShouldPassForThe<TComponent>(Func<TComponent, Boolean>)
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 Source

AndAlso()

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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>.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Extension Methods

ModelErrorDetailsTestBuilderViewFeaturesExtensions.ContainingErrorFor<TModel, TMember>(Expression<Func<TModel, TMember>>)
ModelErrorDetailsTestBuilderViewFeaturesExtensions.ContainingNoErrorFor<TModel, TMember>(Expression<Func<TModel, TMember>>)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2016 MyTestedASP.NET. All Rights Reserved. Generated by DocFX