Skip to content

Commit cfcb47c

Browse files
authored
Move from switch-statement to football-match-reports slug (exercism#1910)
* Move from switch-statement to football-match-reports slug * remove old switch-statement folder * fix config
1 parent a13f000 commit cfcb47c

12 files changed

Lines changed: 44 additions & 40 deletions

File tree

config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@
164164
"status": "wip"
165165
},
166166
{
167-
"slug": "switch-statement",
167+
"slug": "football-match-reports",
168+
"name": "Football Match Reports",
168169
"uuid": "5eb11198-807c-469f-903e-57b4f931c02c",
169170
"concepts": [
170171
"switch-statement"
File renamed without changes.

exercises/concept/switch-statement/.docs/instructions.md renamed to exercises/concept/football-match-reports/.docs/instructions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ The player descriptions are as follows:
1919
11 -> "right wing"
2020
```
2121

22-
Implement the static `PlayAnalyzer.onField()` method to output a player description based on their shirt number.
22+
Implement the static `FootballMatchReports.onField()` method to output a player description based on their shirt number.
2323

2424
```java
25-
PlayAnalyzer.onField(10);
25+
FootballMatchReports.onField(10);
2626
// => "striker"
2727
```
2828

2929
## 2. Raise an alert if an unknown shirt number is encountered
3030

31-
Modify the `PlayAnalyzer.onField()` method to throw an `IllegalArgumentException` when a shirt number outside the range 1-11 is processed.
31+
Modify the `FootballMatchReports.onField()` method to throw an `IllegalArgumentException` when a shirt number outside the range 1-11 is processed.
3232

3333
```java
34-
PlayAnalyer.onField(13);
34+
FootballMatchReports.onField(13);
3535
// => Throw IllegalArgumentException
3636
```

exercises/concept/switch-statement/.docs/introduction.md renamed to exercises/concept/football-match-reports/.docs/introduction.md

File renamed without changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"blurb": "TODO: add blurb for football-match-reports exercise",
3+
"authors": [
4+
"Azumix"
5+
],
6+
"files": {
7+
"solution": [
8+
"src/main/java/FootballMatchReports.java"
9+
],
10+
"test": [
11+
"src/test/java/FootballMatchReportsTest.java"
12+
],
13+
"exemplar": [
14+
".meta/src/reference/java/FootballMatchReports.java"
15+
]
16+
},
17+
"forked_from": [
18+
"csharp/football-match-reports"
19+
]
20+
}
File renamed without changes.

exercises/concept/switch-statement/.meta/src/reference/java/PlayAnalyzer.java renamed to exercises/concept/football-match-reports/.meta/src/reference/java/FootballMatchReports.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public class PlayAnalyzer {
1+
public class FootballMatchReports {
22
public static String onField(int shirtNum) {
33
String playerDescription = "";
44
switch (shirtNum) {
File renamed without changes.

exercises/concept/switch-statement/src/main/java/PlayAnalyzer.java renamed to exercises/concept/football-match-reports/src/main/java/FootballMatchReports.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
public class PlayAnalyzer {
1+
public class FootballMatchReports {
22
public static String onField(int shirtNum) {
3-
throw new UnsupportedOperationException("Please implement the (static) PlayAnalyzer.onField() method");
3+
throw new UnsupportedOperationException("Please implement the (static) FootballMatchReports.onField() method");
44
}
55
}

exercises/concept/switch-statement/src/test/java/PlayAnalyzerTest.java renamed to exercises/concept/football-match-reports/src/test/java/FootballMatchReportsTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,67 @@
33

44
import static org.assertj.core.api.Assertions.*;
55

6-
public class PlayAnalyzerTest {
6+
public class FootballMatchReportsTest {
77

88
@Test
99
public void test_goal() {
10-
assertThat(PlayAnalyzer.onField(1).contentEquals("goalie"));
10+
assertThat(FootballMatchReports.onField(1).contentEquals("goalie"));
1111
}
1212

1313
@Test
1414
@Ignore("Remove to run test")
1515
public void test_left_back() {
16-
assertThat(PlayAnalyzer.onField(2).contentEquals("left back"));
16+
assertThat(FootballMatchReports.onField(2).contentEquals("left back"));
1717
}
1818

1919
@Test
2020
@Ignore("Remove to run test")
2121
public void test_right_back() {
22-
assertThat(PlayAnalyzer.onField(5).contentEquals("right back"));
22+
assertThat(FootballMatchReports.onField(5).contentEquals("right back"));
2323
}
2424

2525
@Test
2626
@Ignore("Remove to run test")
2727
public void test_center_back() {
28-
assertThat(PlayAnalyzer.onField(3).contentEquals("center back"));
29-
assertThat(PlayAnalyzer.onField(4).contentEquals("center back"));
28+
assertThat(FootballMatchReports.onField(3).contentEquals("center back"));
29+
assertThat(FootballMatchReports.onField(4).contentEquals("center back"));
3030
}
3131

3232
@Test
3333
@Ignore("Remove to run test")
3434
public void test_midfielder() {
35-
assertThat(PlayAnalyzer.onField(6).contentEquals("midfielder"));
36-
assertThat(PlayAnalyzer.onField(7).contentEquals("midfielder"));
37-
assertThat(PlayAnalyzer.onField(8).contentEquals("midfielder"));
35+
assertThat(FootballMatchReports.onField(6).contentEquals("midfielder"));
36+
assertThat(FootballMatchReports.onField(7).contentEquals("midfielder"));
37+
assertThat(FootballMatchReports.onField(8).contentEquals("midfielder"));
3838
}
3939

4040
@Test
4141
@Ignore("Remove to run test")
4242
public void test_left_wing() {
43-
assertThat(PlayAnalyzer.onField(9).contentEquals("left wing"));
43+
assertThat(FootballMatchReports.onField(9).contentEquals("left wing"));
4444
}
4545

4646
@Test
4747
@Ignore("Remove to run test")
4848
public void test_striker() {
49-
assertThat(PlayAnalyzer.onField(10).contentEquals("striker"));
49+
assertThat(FootballMatchReports.onField(10).contentEquals("striker"));
5050
}
5151

5252
@Test
5353
@Ignore("Remove to run test")
5454
public void test_right_wing() {
55-
assertThat(PlayAnalyzer.onField(11).contentEquals("right wing"));
55+
assertThat(FootballMatchReports.onField(11).contentEquals("right wing"));
5656
}
5757

5858
@Test(expected = IllegalArgumentException.class)
5959
@Ignore("Remove to run test")
6060
public void test_exception() {
61-
PlayAnalyzer.onField(13);
61+
FootballMatchReports.onField(13);
6262
}
6363

6464
@Test(expected = IllegalArgumentException.class)
6565
@Ignore("Remove to run test")
6666
public void test_exception_negative_number() {
67-
PlayAnalyzer.onField(-1);
67+
FootballMatchReports.onField(-1);
6868
}
6969
}

0 commit comments

Comments
 (0)