Class ComponentShouldHaveTestBuilderViewBagExtensions
Contains dynamic view bag extension methods for IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>.
Inheritance
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.ViewData.dll
Syntax
public static class ComponentShouldHaveTestBuilderViewBagExtensions
Methods
| Improve this Doc View SourceNoViewBag<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>)
Tests whether the component does not set any dynamic view bag entries.
Declaration
public static TBuilder NoViewBag<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. |
ViewBag<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>, Action<IViewBagTestBuilder>)
Tests whether the component sets specific entries in the Microsoft.AspNetCore.Mvc.Controller.ViewBag.
Declaration
public static TBuilder ViewBag<TBuilder>(this IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> builder, Action<IViewBagTestBuilder> viewBagTestBuilder)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> type. |
System.Action<IViewBagTestBuilder> | viewBagTestBuilder | Builder for testing specific dynamic view bag 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. |
ViewBag<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>, Nullable<Int32>)
Tests whether the component sets entries in the dynamic view bag.
Declaration
public static TBuilder ViewBag<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 dynamic view bag 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. |