import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

public class RemoteControlCarTest {
    @Test
    public void Buy_new_car_returns_instance() {
        RemoteControlCar car = RemoteControlCar.buy();
        Assert.assertNotNull(car);
    }

    @Ignore("Remove to run test")
    @Test
    public void Buy_new_car_returns_new_car_each_time() {
        RemoteControlCar car1 = RemoteControlCar.buy();
        RemoteControlCar car2 = RemoteControlCar.buy();
        Assert.assertNotSame(car2, car1);
    }

    @Ignore("Remove to run test")
    @Test
    public void New_car_distance_display() {
        RemoteControlCar car = new RemoteControlCar();
        Assert.assertEquals("Driven 0 meters", car.distanceDisplay());
    }

    @Ignore("Remove to run test")
    @Test
    public void New_car_battery_display() {
        RemoteControlCar car = new RemoteControlCar();
        Assert.assertEquals("Battery at 100%", car.batteryDisplay());
    }

    @Ignore("Remove to run test")
    @Test
    public void Distance_display_after_driving_once() {
        RemoteControlCar car = new RemoteControlCar();
        car.drive();
        Assert.assertEquals("Driven 20 meters", car.distanceDisplay());
    }

    @Ignore("Remove to run test")
    @Test
    public void Distance_display_after_driving_multiple_times() {
        RemoteControlCar car = new RemoteControlCar();

        for (int i = 0; i < 17; i++) {
            car.drive();
        }

        Assert.assertEquals("Driven 340 meters", car.distanceDisplay());
    }

    @Ignore("Remove to run test")
    @Test
    public void Battery_display_after_driving_once() {
        RemoteControlCar car = new RemoteControlCar();
        car.drive();
        Assert.assertEquals("Battery at 99%", car.batteryDisplay());
    }

    @Ignore("Remove to run test")
    @Test
    public void Battery_display_after_driving_multiple_times() {
        RemoteControlCar car = new RemoteControlCar();

        for (int i = 0; i < 23; i++) {
            car.drive();
        }

        Assert.assertEquals("Battery at 77%", car.batteryDisplay());
    }

    @Ignore("Remove to run test")
    @Test
    public void Battery_display_when_battery_empty() {
        RemoteControlCar car = new RemoteControlCar();

        // Drain the battery
        for (int i = 0; i < 100; i++) {
            car.drive();
        }

        // Attempt to drive one more time (should not work)
        car.drive();

        Assert.assertEquals("Battery empty", car.batteryDisplay());
    }

    @Ignore("Remove to run test")
    @Test
    public void Distance_display_when_battery_empty() {
        RemoteControlCar car = new RemoteControlCar();

        // Drain the battery
        for (int i = 0; i < 100; i++) {
            car.drive();
        }

        // Attempt to drive one more time (should not work)
        car.drive();

        Assert.assertEquals("Driven 2000 meters", car.distanceDisplay());
    }
}

@@ -121,33 +121,33 @@
     public void 
-B
+b
 uy_new_car_retur
@@ -319,17 +319,17 @@
 ic void 
-B
+b
 uy_new_c
@@ -578,25 +578,25 @@
 public void 
-N
+n
 ew_car_dista
@@ -804,17 +804,17 @@
 ic void 
-N
+n
 ew_car_b
@@ -1016,33 +1016,33 @@
     public void 
-D
+d
 istance_display_
@@ -1271,33 +1271,33 @@
     public void 
-D
+d
 istance_display_
@@ -1592,33 +1592,33 @@
     public void 
-B
+b
 attery_display_a
@@ -1843,33 +1843,33 @@
     public void 
-B
+b
 attery_display_a
@@ -2167,17 +2167,17 @@
 ic void 
-B
+b
 attery_d
@@ -2584,17 +2584,17 @@
 ic void 
-D
+d
 istance_

fix settings and style in classes concept exercise