Add oving 7
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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 TrainCarTest {
|
||||
|
||||
private TrainCar trainCar;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
trainCar = new TrainCar(3000);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Dead weight equals total weight")
|
||||
public void testDeadWeight() {
|
||||
assertEquals(3000, trainCar.getTotalWeight(), "Test initialization of dead weight");
|
||||
|
||||
trainCar.setDeadWeight(5000);
|
||||
assertEquals(5000, trainCar.getTotalWeight(),
|
||||
"Test that total weight equals set dead weight");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user