feat: pr suggestions

pull/24/head
Erick Zanardo 4 years ago
parent 2bc3c1f4a0
commit dc896662c0

@ -34,7 +34,11 @@ class Scored extends GameEvent {
}
class BonusLetterActivated extends GameEvent {
const BonusLetterActivated(this.letterIndex);
const BonusLetterActivated(this.letterIndex)
: assert(
letterIndex < GameBloc.bonusWord.length,
'Index must be smaller than the length of the word',
);
final int letterIndex;

@ -56,6 +56,16 @@ void main() {
isNot(equals(BonusLetterActivated(1))),
);
});
test(
'throws assertion error if index is bigger than the word length',
() {
expect(
() => BonusLetterActivated(8),
throwsAssertionError,
);
},
);
});
});
}

Loading…
Cancel
Save