Skip to content

Commit

Permalink
Sync tests for practice exercise bowling (#2530)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderploegsma authored Oct 25, 2023
1 parent 477240a commit 64b400c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
16 changes: 13 additions & 3 deletions exercises/practice/bowling/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[656ae006-25c2-438c-a549-f338e7ec7441]
description = "should be able to score a game with all zeros"
Expand Down Expand Up @@ -38,6 +45,9 @@ description = "rolling a spare with the two roll bonus does not get a bonus roll
[576faac1-7cff-4029-ad72-c16bcada79b5]
description = "strikes with the two roll bonus do not get bonus rolls"

[efb426ec-7e15-42e6-9b96-b4fca3ec2359]
description = "last two strikes followed by only last bonus with non strike points"

[72e24404-b6c6-46af-b188-875514c0377b]
description = "a strike with the one roll bonus after a spare in the last frame does not get a bonus"

Expand Down
1 change: 0 additions & 1 deletion exercises/practice/bowling/.meta/version

This file was deleted.

15 changes: 12 additions & 3 deletions exercises/practice/bowling/src/test/java/BowlingGameTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

import org.junit.Ignore;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

public class BowlingGameTest {
private BowlingGame game = new BowlingGame();

Expand Down Expand Up @@ -120,6 +120,15 @@ public void strikesWithTheTwoRollBonusDoNotGetBonusRolls() {
assertThat(game.score()).isEqualTo(30);
}

@Ignore("Remove to run test")
@Test
public void lastTwoStrikesFollowedByOnlyLastBonusWithNonStrikePoints() {
int[] rolls = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 1};

playGame(rolls);
assertThat(game.score()).isEqualTo(31);
}

@Ignore("Remove to run test")
@Test
public void aStrikeWithTheOneRollBonusAfterASpareInTheLastFrameDoesNotGetABonus() {
Expand Down

0 comments on commit 64b400c

Please sign in to comment.