Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: increasing mini sprite core tests #32

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mini_sprite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
uses: VeryGoodOpenSource/very_good_coverage@v1
with:
path: packages/mini_sprite/coverage/lcov.info
min_coverage: 60
min_coverage: 100
37 changes: 37 additions & 0 deletions packages/mini_sprite/test/src/mini_map_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:mini_sprite/mini_sprite.dart';
import 'package:test/test.dart';

void main() {
group('MiniMap', () {
test('fromDataString returns the correct instance', () {
const data = '[{"x": 0, "y": 0, "data": {"sprite": "player"}}]';
final instance = MiniMap.fromDataString(data);

expect(
instance,
MiniMap(
objects: {
const MapPosition(0, 0): const <String, dynamic>{
'sprite': 'player',
},
},
),
);
});

test('toDataString returns the correct serialized data', () {
const data = '[{"x":0,"y":0,"data":{"sprite":"player"}}]';

expect(
MiniMap(
objects: {
const MapPosition(0, 0): const <String, dynamic>{
'sprite': 'player',
},
},
).toDataString(),
equals(data),
);
});
});
}