Skip to content

Commit

Permalink
test: add application cache unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
brunogabriel committed Oct 30, 2024
1 parent 4b84ab8 commit 1c21432
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 30 deletions.
1 change: 1 addition & 0 deletions pokedex/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dev_dependencies:
build_runner: ^2.4.6
freezed: ^2.4.1
json_serializable: ^6.7.1
mocktail: ^1.0.4

flutter:
uses-material-design: true
Expand Down
18 changes: 18 additions & 0 deletions pokedex/test/cache/application_cache_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:pokedex_flutter/cache/application_cache.dart';

void main() {
late ApplicationCache applicationCache;

setUp(() {
applicationCache = MemoryCacheImpl();
});

test(
'should save data '
'in memory', () {
final dynamic = {'object': 'value'};
applicationCache.putValue('key', dynamic);
expect(applicationCache.getValue('key'), dynamic);
});
}
30 changes: 0 additions & 30 deletions pokedex/test/widget_test.dart

This file was deleted.

0 comments on commit 1c21432

Please sign in to comment.