diff --git a/exercises/concept/need-for-speed/src/test/java/NeedForSpeedTest.java b/exercises/concept/need-for-speed/src/test/java/NeedForSpeedTest.java index 70eea7999..f29eda17d 100644 --- a/exercises/concept/need-for-speed/src/test/java/NeedForSpeedTest.java +++ b/exercises/concept/need-for-speed/src/test/java/NeedForSpeedTest.java @@ -60,6 +60,17 @@ public void new_remote_control_car_battery_is_not_drained() { assertThat(car.batteryDrained()).isFalse(); } + @Test + @Tag("task:4") + @DisplayName("The batteryDrained method returns false when there's not enough battery") + public void new_remote_control_car_that_can_only_drive_once() { + var car = new NeedForSpeed(1, 99); + car.drive(); + assertThat(car.batteryDrained()).isTrue(); + // Ensure that the car was driven once + assertThat(car.distanceDriven()).isEqualTo(1); + } + @Test @Tag("task:4") @DisplayName("The batteryDrained method returns false when car battery did not completely drain after driving")