Class ComponentShouldHaveTestBuilderViewDataExtensions
Contains Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary extension methods for IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>.
Inheritance
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.ViewData.dll
Syntax
public static class ComponentShouldHaveTestBuilderViewDataExtensions
Methods
| Improve this Doc View SourceNoViewData<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>)
Tests whether the action does not set any Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary entries.
Declaration
public static TBuilder NoViewData<TBuilder>(this IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> builder)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> type. |
Returns
Type | Description |
---|---|
TBuilder | The same component should have test builder. |
Type Parameters
Name | Description |
---|---|
TBuilder | Class representing ASP.NET Core MVC test builder. |
ViewData<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>, Action<IViewDataTestBuilder>)
Tests whether the action sets specific entries in the Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary.
Declaration
public static TBuilder ViewData<TBuilder>(this IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> builder, Action<IViewDataTestBuilder> viewDataTestBuilder)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> type. |
System.Action<IViewDataTestBuilder> | viewDataTestBuilder | Builder for testing specific Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary entries. |
Returns
Type | Description |
---|---|
TBuilder | The same component should have test builder. |
Type Parameters
Name | Description |
---|---|
TBuilder | Class representing ASP.NET Core MVC test builder. |
ViewData<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>, Nullable<Int32>)
Tests whether the action sets entries in the Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary.
Declaration
public static TBuilder ViewData<TBuilder>(this IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> builder, int ? withNumberOfEntries = null)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> type. |
System.Nullable<System.Int32> | withNumberOfEntries | Expected number of Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary entries. If default null is provided, the test builder checks only if any entries are found. |
Returns
Type | Description |
---|---|
TBuilder | The same component should have test builder. |
Type Parameters
Name | Description |
---|---|
TBuilder | Class representing ASP.NET Core MVC test builder. |