This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/trashy_road/test/src/maps/bloc/game_maps_state_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:trashy_road/src/maps/maps.dart'; | ||
|
||
void main() { | ||
group('$ScoreRating', () { | ||
group('fromSteps', () { | ||
test( | ||
'returns ScoreRating.none when score is less than the first step', | ||
() { | ||
final rating = ScoreRating.fromSteps(score: 0, steps: (1, 2, 3)); | ||
expect(rating, ScoreRating.none); | ||
}, | ||
); | ||
|
||
test( | ||
'''returns ScoreRating.bronze when score is greater or equal than the first step ''' | ||
'and less than the second step', | ||
() { | ||
final rating = ScoreRating.fromSteps(score: 1, steps: (1, 2, 3)); | ||
expect(rating, ScoreRating.bronze); | ||
}, | ||
); | ||
|
||
test( | ||
'''returns ScoreRating.silver when score is greater or equal than the second step ''' | ||
'and less than the third step', | ||
() { | ||
final rating = ScoreRating.fromSteps(score: 2, steps: (1, 2, 3)); | ||
expect(rating, ScoreRating.silver); | ||
}, | ||
); | ||
|
||
test( | ||
'''returns ScoreRating.gold when score is greater or equal than the third step''', | ||
() { | ||
final rating = ScoreRating.fromSteps(score: 3, steps: (1, 2, 3)); | ||
expect(rating, ScoreRating.gold); | ||
}, | ||
); | ||
}); | ||
}); | ||
} |