cache_store_testing library
The checks of the contract of a CacheStore (see package:cloud_firestore_dart/cache_store.dart),
for the tests of a store. They need no test framework: each check throws when the store breaks the contract.
import 'package:cloud_firestore_dart/cache_store_testing.dart';
import 'package:test/test.dart';
void main() {
for (final CacheStoreCheck check in cacheStoreConformanceChecks) {
test(check.name, () => check.run(() => MyStore(newEmptyFile())));
}
}
Classes
- CacheStoreCheck
- One check of the contract of a CacheStore, to run in the tests of a store:
Properties
-
cacheStoreConformanceChecks
→ List<
CacheStoreCheck> -
The checks of the contract of a CacheStore (see CacheStoreCheck): reads, writes and deletes,
the byte order of the keys, range scans (bounds, reverse order, limit), writes of puts and deletes together, reads
that run at the same time, keys and values kept byte for byte (also empty values), large writes, and data that is
still there after the store is closed and opened again.
final