Interface IShouldHaveTestBuilder<TActionResult>
Used for testing the action's additional data - action attributes, HTTP response, view bag and more.
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Actions
Assembly:MyTested.AspNetCore.Mvc.Controllers.dll
Syntax
public interface IShouldHaveTestBuilder<TActionResult> : IBaseTestBuilderWithComponentShouldHaveTestBuilder<IAndActionResultTestBuilder<TActionResult>>, IBaseTestBuilder
Type Parameters
Name | Description |
---|---|
TActionResult | Result from invoked action in ASP.NET Core MVC controller. |
Methods
| Improve this Doc View SourceActionAttributes(Action<IActionAttributesTestBuilder>)
Tests whether the action has specific attributes.
Declaration
IAndActionResultTestBuilder<TActionResult> ActionAttributes(Action<IActionAttributesTestBuilder> attributesTestBuilder)
Parameters
Type | Name | Description |
---|---|---|
System.Action<IActionAttributesTestBuilder> | attributesTestBuilder | Builder for testing specific attributes on the action. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Actions.IAndActionResultTestBuilder<TActionResult> | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Actions.IAndActionResultTestBuilder`1 type. |
ActionAttributes(Nullable<Int32>)
Tests whether the action has at least 1 attribute of any type.
Declaration
IAndActionResultTestBuilder<TActionResult> ActionAttributes(int ? withTotalNumberOf = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Int32> | withTotalNumberOf | Optional parameter specifying the exact total number of attributes on the tested action. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Actions.IAndActionResultTestBuilder<TActionResult> | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Actions.IAndActionResultTestBuilder`1 type. |
NoActionAttributes()
Tests whether the action has no attributes of any type.
Declaration
IAndActionResultTestBuilder<TActionResult> NoActionAttributes()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Actions.IAndActionResultTestBuilder<TActionResult> | Test builder of MyTested.AspNetCore.Mvc.Builders.Contracts.Actions.IAndActionResultTestBuilder`1 type. |