-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathCarTest.java
More file actions
35 lines (28 loc) · 1.09 KB
/
CarTest.java
File metadata and controls
35 lines (28 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package org.launchcode.java.demos.lsn5unittesting.test;
import org.junit.Before;
import org.junit.Test;
import org.launchcode.java.demos.lsn5unittesting.main.Car;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
public class CarTest {
Car test_car;
@Before
public void createCarObject() {
test_car = new Car("Toyota","Prius",10,50);
}
//TODO: add emptyTest so we can configure our runtime environment (remove this test before pushing to your personal GitLab account)
@Test
public void emptyTest() {
assertEquals(10,10,.001);
}
//TODO: constructor sets gasTankLevel properly
@Test
public void testInitialGasTank() {
//Car test_car = new Car("Toyota","Prius",10,50);
//assertEquals(10, test_car.getGasTankLevel(),.001);
assertFalse(test_car.getGasTankLevel() == 0);
}
//TODO: gasTankLevel is accurate after driving within tank range
//TODO: gasTankLevel is accurate after attempting to drive past tank range
//TODO: can't have more gas than tank size, expect an exception
}