Files
G4G0-1/Semester 1/Programming 1/Java/examples/projects/chapter16/taxi-company-outline-testing/PassengerTest.java
2024-01-15 20:14:10 +00:00

58 lines
1.1 KiB
Java
Executable File

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* The test class PassengerTest.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.02.29
*/
public class PassengerTest
{
/**
* Default constructor for test class PassengerTest
*/
public PassengerTest()
{
}
/**
* Sets up the test fixture.
*
* Called before every test case method.
*/
@Before
public void setUp()
{
}
/**
* Tears down the test fixture.
*
* Called after every test case method.
*/
@After
public void tearDown()
{
}
/**
* Test basic creation of a passenger.
* Ensure that the pickup and destination locations
* have been set.
*/
@Test
public void testCreation()
{
Location pickup = new Location();
Location destination = new Location();
Passenger passenger1 = new Passenger(pickup, destination);
assertEquals(destination, passenger1.getDestination());
assertEquals(pickup, passenger1.getPickupLocation());
}
}