stash_harness library
Provides testing support to third party extensions, for example store extensions
Classes
- BoolGenerator
- A bool implementation of a ValueGenerator which produces a bool from a provided seed
- DoubleGenerator
- A double implementation of a ValueGenerator which produces a double from a provided seed
- IntGenerator
- A int implementation of a ValueGenerator which produces a int from a provided seed
- IteratorGenerator
- A Iterator implementation of a ValueGenerator which produces a Iterator from a provided seed and a element ValueGenerator
- MapGenerator
- A Map implementation of a ValueGenerator which produces a Map from a provided seed
- SampleClass
- A sample class used to test class serialization / deserialization scenarios
- SampleClassGenerator
- A SampleClass implementation of a ValueGenerator which produces a SampleClass from a provided seed
- StringGenerator
- A String implementation of a ValueGenerator which produces a String from a provided seed and a optional prefix
-
TestContext<
T extends CacheStore> - Base class for all the test contexts.
- ValueGenerator
- Generic definition of a value generator
Functions
-
check<
T extends CacheStore> (TestContext< T> ctx, dynamic actual, dynamic matcher, String reason) → void -
Assert that
actualmatchesmatcherin a specific testctx. -
deleteMemoryStore(
MemoryStore store) → Future< void> - Deletes a MemoryStore
-
newDefaultCache<
T extends CacheStore> (T store, {String? name, ExpiryPolicy? expiryPolicy, KeySampler? sampler, EvictionPolicy? evictionPolicy, int? maxEntries, CacheLoader? cacheLoader, Clock? clock}) → Cache -
Creates a new
DefaultCachebound to an implementation of the CacheStore interface -
newEntry(
ValueGenerator generator, int seed, {String? key, DateTime? expiryTime, DateTime? creationTime, DateTime? accessTime, DateTime? updateTime, int? hitCount}) → CacheEntry -
Creates a new CacheEntry with the provided ValueGenerator and
seed -
newMemoryStore(
) → Future< MemoryStore> - Creates a new MemoryStore
-
testCacheWith<
T extends CacheStore> (TestContext< T> ctx) → Future<void> - Entry point for the cache testing harness. It delegates most of the construction to user provided functions that are responsible for the CacheStore creation, the Cache creation and by the generation of testing values (with a provided ValueGenerator instance). They are encapsulated in provided TestContext object
-
testStoreWith<
T extends CacheStore> (TestContext< T> ctx) → Future<void> - Entry point for the store testing harness. It delegates most of the construction to user provided functions that are responsible for the CacheStore creation, and the generation of testing values (with a provided ValueGenerator instance). They are encapsulated in provided TestContext object
Typedefs
-
CacheBuilder<
T extends CacheStore> = DefaultCache Function(T store, {CacheLoader cacheLoader, Clock clock, EvictionPolicy evictionPolicy, ExpiryPolicy expiryPolicy, int maxEntries, String name, KeySampler sampler}) - Cache builder function
-
StoreBuilder<
T extends CacheStore> = Future< T> Function() - Store builder function