|
|
@ -10,6 +10,7 @@ void main() {
|
|
|
|
GameState(
|
|
|
|
GameState(
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: const [],
|
|
|
|
activatedBonusLetters: const [],
|
|
|
|
activatedDashNests: const {},
|
|
|
|
activatedDashNests: const {},
|
|
|
|
bonusHistory: const [],
|
|
|
|
bonusHistory: const [],
|
|
|
@ -18,6 +19,7 @@ void main() {
|
|
|
|
const GameState(
|
|
|
|
const GameState(
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
|
bonusHistory: [],
|
|
|
|
bonusHistory: [],
|
|
|
@ -32,6 +34,7 @@ void main() {
|
|
|
|
const GameState(
|
|
|
|
const GameState(
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
|
bonusHistory: [],
|
|
|
|
bonusHistory: [],
|
|
|
@ -49,6 +52,25 @@ void main() {
|
|
|
|
() => GameState(
|
|
|
|
() => GameState(
|
|
|
|
balls: -1,
|
|
|
|
balls: -1,
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
|
|
|
|
activatedBonusLetters: const [],
|
|
|
|
|
|
|
|
activatedDashNests: const {},
|
|
|
|
|
|
|
|
bonusHistory: const [],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
throwsAssertionError,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
|
|
|
'throws AssertionError '
|
|
|
|
|
|
|
|
'when bonusBalls are negative',
|
|
|
|
|
|
|
|
() {
|
|
|
|
|
|
|
|
expect(
|
|
|
|
|
|
|
|
() => GameState(
|
|
|
|
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
score: 0,
|
|
|
|
|
|
|
|
bonusBalls: -1,
|
|
|
|
activatedBonusLetters: const [],
|
|
|
|
activatedBonusLetters: const [],
|
|
|
|
activatedDashNests: const {},
|
|
|
|
activatedDashNests: const {},
|
|
|
|
bonusHistory: const [],
|
|
|
|
bonusHistory: const [],
|
|
|
@ -65,6 +87,7 @@ void main() {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
|
() => GameState(
|
|
|
|
() => GameState(
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
score: -1,
|
|
|
|
score: -1,
|
|
|
|
activatedBonusLetters: const [],
|
|
|
|
activatedBonusLetters: const [],
|
|
|
|
activatedDashNests: const {},
|
|
|
|
activatedDashNests: const {},
|
|
|
@ -82,6 +105,7 @@ void main() {
|
|
|
|
const gameState = GameState(
|
|
|
|
const gameState = GameState(
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
|
bonusHistory: [],
|
|
|
|
bonusHistory: [],
|
|
|
@ -95,6 +119,7 @@ void main() {
|
|
|
|
const gameState = GameState(
|
|
|
|
const gameState = GameState(
|
|
|
|
balls: 1,
|
|
|
|
balls: 1,
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
|
bonusHistory: [],
|
|
|
|
bonusHistory: [],
|
|
|
@ -110,6 +135,7 @@ void main() {
|
|
|
|
const gameState = GameState(
|
|
|
|
const gameState = GameState(
|
|
|
|
balls: 3,
|
|
|
|
balls: 3,
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: [1],
|
|
|
|
activatedBonusLetters: [1],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
|
bonusHistory: [],
|
|
|
|
bonusHistory: [],
|
|
|
@ -124,6 +150,7 @@ void main() {
|
|
|
|
const gameState = GameState(
|
|
|
|
const gameState = GameState(
|
|
|
|
balls: 3,
|
|
|
|
balls: 3,
|
|
|
|
score: 0,
|
|
|
|
score: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: [1],
|
|
|
|
activatedBonusLetters: [1],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
|
bonusHistory: [],
|
|
|
|
bonusHistory: [],
|
|
|
@ -140,6 +167,7 @@ void main() {
|
|
|
|
() {
|
|
|
|
() {
|
|
|
|
const gameState = GameState(
|
|
|
|
const gameState = GameState(
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
score: 2,
|
|
|
|
score: 2,
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
@ -158,6 +186,7 @@ void main() {
|
|
|
|
() {
|
|
|
|
() {
|
|
|
|
const gameState = GameState(
|
|
|
|
const gameState = GameState(
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
score: 2,
|
|
|
|
score: 2,
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
@ -177,6 +206,7 @@ void main() {
|
|
|
|
const gameState = GameState(
|
|
|
|
const gameState = GameState(
|
|
|
|
score: 2,
|
|
|
|
score: 2,
|
|
|
|
balls: 0,
|
|
|
|
balls: 0,
|
|
|
|
|
|
|
|
bonusBalls: 0,
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedBonusLetters: [],
|
|
|
|
activatedDashNests: {},
|
|
|
|
activatedDashNests: {},
|
|
|
|
bonusHistory: [],
|
|
|
|
bonusHistory: [],
|
|
|
@ -184,6 +214,7 @@ void main() {
|
|
|
|
final otherGameState = GameState(
|
|
|
|
final otherGameState = GameState(
|
|
|
|
score: gameState.score + 1,
|
|
|
|
score: gameState.score + 1,
|
|
|
|
balls: gameState.balls + 1,
|
|
|
|
balls: gameState.balls + 1,
|
|
|
|
|
|
|
|
bonusBalls: gameState.bonusBalls + 1,
|
|
|
|
activatedBonusLetters: const [0],
|
|
|
|
activatedBonusLetters: const [0],
|
|
|
|
activatedDashNests: const {'1'},
|
|
|
|
activatedDashNests: const {'1'},
|
|
|
|
bonusHistory: const [GameBonus.word],
|
|
|
|
bonusHistory: const [GameBonus.word],
|
|
|
|