import junit.framework.TestCase;

/**
 * A test class for the Car class.
 */
public class CarTester extends TestCase {
  
  /**
   * Test whether the constructor and the getter methods work properly.
   */
  public void testConstructorAndGetters() {
    Car c = new Car(2005, "Honda", "Civic", "red", 15000.0);
    
    assertEquals(2005, c.getYear());
    assertEquals("Honda", c.getBrand());
    assertEquals("Civic", c.getModel());
    assertEquals("red", c.getColour());
    assertEquals(15000.0, c.getPrice());
    assertNull(c.getLicensePlate());
  }
  
  /**
   * Test whether setting the license plate works.
   */
  public void testSetLicensePlate() {
    Car c = new Car(2005, "Honda", "Civic", "red", 15000.0);
    
    assertNull(c.getLicensePlate());
    c.setLicensePlate("APS 101");
    assertEquals("APS 101", c.getLicensePlate());
  }
  
}