Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void distanceDisplayAfterDrivingMultipleTimes() {
public void batteryDisplayAfterDrivingOnce() {
JedliksToyCar car = new JedliksToyCar();
car.drive();

assertThat(car.batteryDisplay()).isEqualTo("Battery at 99%");
}

Expand Down
6 changes: 3 additions & 3 deletions exercises/concept/log-levels/src/test/java/LogLevelsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ public void errorReformat() {
@DisplayName("The reformat method correctly reformats a warning log line")
public void warningReformat() {
assertThat(LogLevels.reformat("[WARNING]: Decreased performance"))
.isEqualTo("Decreased performance (warning)");
.isEqualTo("Decreased performance (warning)");
}

@Test
@Tag("task:3")
@DisplayName("The reformat method correctly reformats an info log line")
public void infoReformat() {
assertThat(LogLevels.reformat("[INFO]: Disk defragmented"))
.isEqualTo("Disk defragmented (info)");
.isEqualTo("Disk defragmented (info)");
}

@Test
@Tag("task:3")
@DisplayName("The reformat method correctly reformats an error log line removing spaces")
public void reformatWithLeadingAndTrailingWhiteSpace() {
assertThat(LogLevels.reformat("[ERROR]: \t Corrupt disk\t \t \r\n"))
.isEqualTo("Corrupt disk (error)");
.isEqualTo("Corrupt disk (error)");
}
}
16 changes: 8 additions & 8 deletions exercises/practice/micro-blog/src/test/java/MicroBlogTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class MicroBlogTest {

private final MicroBlog microBlog = new MicroBlog();

@Test
@DisplayName("English language short")
public void englishLanguageShort() {
Expand All @@ -22,7 +22,7 @@ public void englishLanguageLong() {
String expected = "Hello";
assertThat(microBlog.truncate("Hello there")).isEqualTo(expected);
}

@Disabled("Remove to run test")
@Test
@DisplayName("German language short (broth)")
Expand All @@ -38,7 +38,7 @@ public void germanLanguageLongBearCarpetToBeards() {
String expected = "Bärte";
assertThat(microBlog.truncate("Bärteppich")).isEqualTo(expected);
}

@Disabled("Remove to run test")
@Test
@DisplayName("Bulgarian language short (good)")
Expand All @@ -54,7 +54,7 @@ public void greekLanguageShortHealth() {
String expected = "υγειά";
assertThat(microBlog.truncate("υγειά")).isEqualTo(expected);
}

@Disabled("Remove to run test")
@Test
@DisplayName("Maths short")
Expand All @@ -70,31 +70,31 @@ public void mathsLong() {
String expected = "∅⊊ℕ⊊ℤ";
assertThat(microBlog.truncate("∅⊊ℕ⊊ℤ⊊ℚ⊊ℝ⊊ℂ")).isEqualTo(expected);
}

@Disabled("Remove to run test")
@Test
@DisplayName("English and emoji short")
public void englishAndEmojiShort() {
String expected = "Fly 🛫";
assertThat(microBlog.truncate("Fly 🛫")).isEqualTo(expected);
}

@Disabled("Remove to run test")
@Test
@DisplayName("Emoji short")
public void emojiShort() {
String expected = "💇";
assertThat(microBlog.truncate("💇")).isEqualTo(expected);
}

@Disabled("Remove to run test")
@Test
@DisplayName("Emoji long")
public void emojiLong() {
String expected = "❄🌡🤧🤒🏥";
assertThat(microBlog.truncate("❄🌡🤧🤒🏥🕰😀")).isEqualTo(expected);
}

@Disabled("Remove to run test")
@Test
@DisplayName("Royal Flush?")
Expand Down