public void NewRemoteControlCarBatteryIsNotDrained() { int speed = 15; int batteryDrain = 3; var car = new RemoteControlCar(speed, batteryDrain); Assert.False(car.BatteryDrained()); }
public void New_remote_control_car_battery_is_not_drained() { int speed = 15; int batteryDrain = 3; var car = new RemoteControlCar(speed, batteryDrain); Assert.False(car.BatteryDrained()); }
public bool CarCanFinish(RemoteControlCar car) { while (!car.BatteryDrained()) { car.Drive(); } return(car.DistanceDriven() >= distance); }
public void Super_hungry_car_after_one_drive_is_drained() { int speed = 100; int batteryDrain = 60; var car = new RemoteControlCar(speed, batteryDrain); car.Drive(); Assert.True(car.BatteryDrained()); }
public bool TryFinishTrack(RemoteControlCar car) { while (!car.BatteryDrained() && car.DistanceDriven() < distance) { car.Drive(); } return(car.DistanceDriven() >= distance); }
public void Super_hungry_car_can_try_driving_but_is_drained() { int speed = 100; int batteryDrain = 60; var car = new RemoteControlCar(speed, batteryDrain); car.Drive(); car.Drive(); Assert.True(car.BatteryDrained()); Assert.Equal(100, car.DistanceDriven()); }
public bool CarCanFinish(RemoteControlCar car) { while (car.DistanceDriven() < Distance) { if (car.BatteryDrained()) { return(false); } car.Drive(); } return(true); }
public void DriveUntilBatteryIsDrained() { int speed = 2; int batteryDrain = 1; var car = new RemoteControlCar(speed, batteryDrain); // Drain the battery for (var i = 0; i < 100; i++) { car.Drive(); } Assert.True(car.BatteryDrained()); }
public void DriveToAlmostDrainBattery() { int speed = 2; int batteryDrain = 1; var car = new RemoteControlCar(speed, batteryDrain); // Almost drain the battery for (var i = 0; i < 99; i++) { car.Drive(); } Assert.False(car.BatteryDrained()); }
private bool CanContinueDriving(RemoteControlCar car) => car.DistanceDriven() < _distance && !car.BatteryDrained();