Class ComponentShouldHaveTestBuilderCachingExtensions
Contains Microsoft.Extensions.Caching.Memory.IMemoryCache extension methods for IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>.
Inheritance
Namespace:MyTested.AspNetCore.Mvc
Assembly:MyTested.AspNetCore.Mvc.Caching.dll
Syntax
public static class ComponentShouldHaveTestBuilderCachingExtensions
Methods
| Improve this Doc View SourceMemoryCache<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>, Action<IMemoryCacheTestBuilder>)
Tests whether the component sets specific Microsoft.Extensions.Caching.Memory.IMemoryCache entries.
Declaration
public static TBuilder MemoryCache<TBuilder>(this IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> builder, Action<IMemoryCacheTestBuilder> memoryCacheTestBuilder)where TBuilder : IBaseTestBuilder
Parameters
Type | Name | Description |
---|---|---|
IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> | builder | Instance of IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder> type. |
System.Action<IMemoryCacheTestBuilder> | memoryCacheTestBuilder | Builder for testing specific Microsoft.Extensions.Caching.Memory.IMemoryCache 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. |
MemoryCache<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>, Nullable<Int32>)
Tests whether the component sets entries in the Microsoft.Extensions.Caching.Memory.IMemoryCache.
Declaration
public static TBuilder MemoryCache<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.Extensions.Caching.Memory.IMemoryCache 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. |
NoMemoryCache<TBuilder>(IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>)
Tests whether the component does not set any Microsoft.Extensions.Caching.Memory.IMemoryCache entries.
Declaration
public static TBuilder NoMemoryCache<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. |