JUnit Exercise

Given the Javadoc for the following class write a JUnit test case for inflate().

Constructor Detail

Tire

public Tire()


Creates a tire with:
Pressure = 35 PSI

Method Detail

getPressure

public int getPressure()

Determines the current tire pressure.

Returns:

int the current tire pressure 0 - 55 PSI (inclusive)


inflate

public void inflate(int amount)

Inflates or deflates the tire by the specified amount in PSI.

Parameters:

amount - to change tire inflation in PSI. Regardless of input the tire can only deflate or inflate to a minimum of 0 PSI and maximum of 55 PSI.

Solution