-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectTest.java
More file actions
113 lines (95 loc) · 3.21 KB
/
ProjectTest.java
File metadata and controls
113 lines (95 loc) · 3.21 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.*;
public class ProjectTest {
@Test
public void readFile1() throws IOException {
City Atlanta = FileInput.readFile("DATA/Atlanta.tsp");
assertEquals(Atlanta.getName(), "Atlanta");
assertEquals(Atlanta.getNum(), 20);
}
@Test
public void readFile2() throws IOException {
City Atlanta = FileInput.readFile("DATA/Berlin.tsp");
assertEquals(Atlanta.getName(), "Berlin");
assertEquals(Atlanta.getNum(), 52);
}
@Test
public void readFile3() throws IOException {
City Atlanta = FileInput.readFile("DATA/Boston.tsp");
assertEquals(Atlanta.getName(), "Boston");
assertEquals(Atlanta.getNum(), 40);
}
@Test
public void readFile4() throws IOException {
City Atlanta = FileInput.readFile("DATA/NYC.tsp");
assertEquals(Atlanta.getName(), "NYC");
assertEquals(Atlanta.getNum(), 68);
}
@Test
public void readFile5() throws IOException {
City Atlanta = FileInput.readFile("DATA/Toronto.tsp");
assertEquals(Atlanta.getName(), "Toronto");
assertEquals(Atlanta.getNum(), 109);
}
@Test
public void createCity1() {
City city = new City("Ann Arbor", 10);
assertEquals(city.getName(), "Ann Arbor");
assertEquals(city.getNum(), 10);
}
@Test
public void createCity2() {
City city = new City("Flint", 15);
assertEquals(city.getName(), "Flint");
assertEquals(city.getNum(), 15);
}
@Test
public void createCity3() {
City city = new City("Grand Rapids", 20);
assertEquals(city.getName(), "Grand Rapids");
assertEquals(city.getNum(), 20);
}
@Test
public void createCity4() {
City city = new City("Detroit", 7);
assertEquals(city.getName(), "Detroit");
assertEquals(city.getNum(), 7);
}
@Test
public void createCity5() {
City city = new City("Plymouth", 9);
assertEquals(city.getName(), "Plymouth");
assertEquals(city.getNum(), 9);
}
@Test
public void createLocation1() {
Location location = new Location(1, 1.0, 2.0);
assertEquals((int) location.getX(), 1);
assertEquals((int) location.getY(), 2);
}
@Test
public void createLocation2() {
Location location = new Location(2, 2.0, 3.0);
assertEquals((int) location.getX(), 2);
assertEquals((int) location.getY(), 3);
}
@Test
public void createLocation3() {
Location location = new Location(2, 3.0, 4.0);
assertEquals((int) location.getX(), 3);
assertEquals((int) location.getY(), 4);
}
@Test
public void createLocation4() {
Location location = new Location(2, 4.0, 5.0);
assertEquals((int) location.getX(), 4);
assertEquals((int) location.getY(), 5);
}
@Test
public void createLocation5() {
Location location = new Location(2, 5.0, 6.0);
assertEquals((int) location.getX(), 5);
assertEquals((int) location.getY(), 6);
}
}