diff --git a/test/store/in_memory_backing_store_test.dart b/test/store/in_memory_backing_store_test.dart index 39ea69c..2f36ad3 100644 --- a/test/store/in_memory_backing_store_test.dart +++ b/test/store/in_memory_backing_store_test.dart @@ -103,20 +103,25 @@ void main() { bStore.set('cModel', cModel); }); - test('returns only changed values', () + test('subscriptions get notified', () { - final store = InMemoryBackingStore() - ..set('name', 'Peter') - ..set('email', 'peter@neverland.com') - ..returnOnlyChangedValues = true; - - final changedEntries = store.iterate().toList(); - expect(changedEntries, hasLength(0)); - - store.set('name', 'Wendy'); + final store = InMemoryBackingStore(); - final changedEntries2 = store.iterate().toList(); - expect(changedEntries2, hasLength(1)); + String? key; + Object? oldValue; + Object? newValue; + final subscriptionId = store.subscribe((k, a, b) { + key = k; + oldValue = a; + newValue = b; + }); + + store.set('name', 'Peter'); + + expect(key, 'name'); + expect(oldValue, null); + expect(newValue, 'Peter'); + expect(subscriptionId, isNotNull); }); }); }