|
@@ -1,32 +1,32 @@
|
1
|
|
-//package Pair;
|
2
|
|
-//
|
3
|
|
-//import org.junit.Test;
|
4
|
|
-//import org.junit.Assert;
|
5
|
|
-//
|
6
|
|
-//public class PairTest {
|
7
|
|
-//
|
8
|
|
-// @Test
|
9
|
|
-// public void testGetters() throws Exception {
|
10
|
|
-// // Given a pair with "Foo" and "Bar"
|
11
|
|
-// Pair<String> p = new Pair<String>("Foo", "Bar");
|
12
|
|
-// // When getFirst and getSecond are called, they should be returned.
|
13
|
|
-// Assert.assertEquals("Foo", p.getFirst());
|
14
|
|
-// Assert.assertEquals("Bar", p.getSecond());
|
15
|
|
-// }
|
16
|
|
-//
|
17
|
|
-// @Test
|
18
|
|
-// public void testMin() throws Exception {
|
19
|
|
-// // Given a pair with two values
|
20
|
|
-// Pair<Double> p = new Pair<Double>(1.23, 2.34);
|
21
|
|
-// // When p.min() is called, the smallest should be returned.
|
22
|
|
-// Assert.assertEquals(new Double(1.23), p.min());
|
23
|
|
-// }
|
24
|
|
-//
|
25
|
|
-// @Test
|
26
|
|
-// public void testMax() throws Exception {
|
27
|
|
-// // Given a pair with two values
|
28
|
|
-// Pair<Double> p = new Pair<Double>(1.23, 2.34);
|
29
|
|
-// // When p.max() is called, the largest should be returned.
|
30
|
|
-// Assert.assertEquals(new Double(2.34), p.max());
|
31
|
|
-// }
|
32
|
|
-//}
|
|
1
|
+package Pair;
|
|
2
|
+
|
|
3
|
+import org.junit.Test;
|
|
4
|
+import org.junit.Assert;
|
|
5
|
+
|
|
6
|
+public class PairTest {
|
|
7
|
+
|
|
8
|
+ @Test
|
|
9
|
+ public void testGetters() throws Exception {
|
|
10
|
+ // Given a pair with "Foo" and "Bar"
|
|
11
|
+ Pair<String> p = new Pair<String>("Foo", "Bar");
|
|
12
|
+ // When getFirst and getSecond are called, they should be returned.
|
|
13
|
+ Assert.assertEquals("Foo", p.getFirst());
|
|
14
|
+ Assert.assertEquals("Bar", p.getSecond());
|
|
15
|
+ }
|
|
16
|
+
|
|
17
|
+ @Test
|
|
18
|
+ public void testMin() throws Exception {
|
|
19
|
+ // Given a pair with two values
|
|
20
|
+ Pair<Double> p = new Pair<Double>(1.23, 2.34);
|
|
21
|
+ // When p.min() is called, the smallest should be returned.
|
|
22
|
+ Assert.assertEquals(new Double(1.23), p.min());
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ @Test
|
|
26
|
+ public void testMax() throws Exception {
|
|
27
|
+ // Given a pair with two values
|
|
28
|
+ Pair<Double> p = new Pair<Double>(1.23, 2.34);
|
|
29
|
+ // When p.max() is called, the largest should be returned.
|
|
30
|
+ Assert.assertEquals(new Double(2.34), p.max());
|
|
31
|
+ }
|
|
32
|
+}
|