package oving7.train;

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

public class PassengerCarTest {

	private PassengerCar passengerCar;

	@BeforeEach
	public void setUp() {
		passengerCar = new PassengerCar(3000, 200);
	}

	@Test
	@DisplayName("Check total weight")
	public void testWeight() {
		assertEquals(3000 + (200 * 80), passengerCar.getTotalWeight(),
				"Test total weight after initialization");

		passengerCar.setPassengerCount(100);
		assertEquals(3000 + (100 * 80), passengerCar.getTotalWeight(),
				"Test total weight after changing the number of passengers");
		assertEquals(100, passengerCar.getPassengerCount(),
				"Test passenger count after changing the number");
	}
}
