-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test2.java
36 lines (28 loc) · 1.11 KB
/
Test2.java
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
class Test2 {
public static void main(String[] args) {
CS2030STest we = new CS2030STest();
we.expect("Circle: new at (0, 0) with radius 4",
new Circle(new Point(0, 0), 4).toString(),
"{ center: (0.0, 0.0), radius: 4.0 }");
we.expect("Circle centered at (0, 0) with radius 4 contains (0, 0)",
new Circle(new Point(0, 0), 4)
.contains(new Point(0, 0)),
true);
we.expect("Circle centered at (0, 0) with radius 4 does not contain (4, 3)",
new Circle(new Point(0, 0), 4)
.contains(new Point(4, 3)),
false);
we.expect("Circle centered at (0, 0) with radius 4 does not contain (3, 4)",
new Circle(new Point(0, 0), 4)
.contains(new Point(3, 4)),
false);
we.expect("Circle centered at (2, -3) with radius 0.5 contains (1.8, -3.1)",
new Circle(new Point(2, -3), 0.5)
.contains(new Point(1.8, -3.1)),
true);
we.expect("Circle centered at (2, -3) with radius 0.5 does not contain (1.8, -4)",
new Circle(new Point(2, -3), 0.5)
.contains(new Point(1.8, -4)),
false);
}
}