Interface IMemoryCacheEntryTestBuilder
Used for testing Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Data
Assembly:MyTested.AspNetCore.Mvc.Caching.dll
Syntax
public interface IMemoryCacheEntryTestBuilder
Methods
| Improve this Doc View SourceWithAbsoluteExpiration(Nullable<DateTimeOffset>)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.AbsoluteExpiration value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryTestBuilder WithAbsoluteExpiration(DateTimeOffset? absoluteExpiration)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.DateTimeOffset> | absoluteExpiration | Absolute expiration value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder. |
WithAbsoluteExpirationRelativeToNow(Nullable<TimeSpan>)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.AbsoluteExpirationRelativeToNow value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryTestBuilder WithAbsoluteExpirationRelativeToNow(TimeSpan? absoluteExpirationRelativeToNow)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | absoluteExpirationRelativeToNow | Absolute expiration relative to now value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder. |
WithPriority(CacheItemPriority)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.Priority value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryTestBuilder WithPriority(CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Caching.Memory.CacheItemPriority | priority | CacheItemPriority value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder. |
WithSlidingExpiration(Nullable<TimeSpan>)
Sets the Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.SlidingExpiration value to the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryTestBuilder WithSlidingExpiration(TimeSpan? slidingExpiration)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | slidingExpiration | Sliding expiration value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder. |
WithValue(Object)
Sets the value of the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry.
Declaration
IAndMemoryCacheEntryTestBuilder WithValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | Cache entry value to set. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Data.IAndMemoryCacheEntryTestBuilder. |
WithValueOfType<TValue>()
Tests whether the built Microsoft.Extensions.Caching.Memory.IMemoryCache entry has value of the provided type.
Declaration
IMemoryCacheEntryDetailsTestBuilder<TValue> WithValueOfType<TValue>()
Returns
Type | Description |
---|---|
IMemoryCacheEntryDetailsTestBuilder<TValue> | Test builder of IMemoryCacheEntryDetailsTestBuilder<TValue> type. |
Type Parameters
Name | Description |
---|---|
TValue | Type of cache entry value. |