Skip to content

Commit

Permalink
Closes #2796
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaquimEsteves committed Jul 13, 2024
1 parent 36a2f5f commit c26e64e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit c26e64e

Please sign in to comment.