MockStorageProvider class

Mock implementation of IStorageProvider for testing.

Stores data in memory, making tests fast and isolated:

final mockStorage = MockStorageProvider();

await FKernal.init(
  config: FKernalConfig(
    baseUrl: 'https://api.example.com',
    cacheProviderOverride: mockStorage,
  ),
  endpoints: endpoints,
);
Implemented types

Constructors

MockStorageProvider()

Properties

allData Map<String, dynamic>
Gets all stored data (for test verification).
no setter
hashCode int
The hash code for this object.
no setterinherited
keys Iterable
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
override
close() Future<void>
override
containsKey(String key) bool
Checks if a key exists.
delete(String key) Future<void>
override
get(String key) Future
override
init() Future<void>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String key, dynamic value) Future<void>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited