|
@@ -1,5 +1,4 @@
|
1
|
1
|
|
2
|
|
-
|
3
|
2
|
import static org.junit.Assert.*;
|
4
|
3
|
import org.junit.After;
|
5
|
4
|
import org.junit.Before;
|
|
@@ -46,6 +45,19 @@ public class PhoneBookTest
|
46
|
45
|
}
|
47
|
46
|
|
48
|
47
|
@Test
|
|
48
|
+ public void testReverseLookup()
|
|
49
|
+ {
|
|
50
|
+ PhoneBook test = new PhoneBook();
|
|
51
|
+ String phoneNumber = "(302)-867-5309";
|
|
52
|
+ String expectedName = "Jenny";
|
|
53
|
+ test.add(expectedName, phoneNumber);
|
|
54
|
+
|
|
55
|
+ String actual = test.reverseLookup(phoneNumber);
|
|
56
|
+ assertEquals(expectedName, actual);
|
|
57
|
+
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ @Test
|
49
|
61
|
public void testRemoveIndividualNumber() {
|
50
|
62
|
PhoneBook test = new PhoneBook();
|
51
|
63
|
String name = "Jenny";
|
|
@@ -54,26 +66,15 @@ public class PhoneBookTest
|
54
|
66
|
test.add(name, number);
|
55
|
67
|
test.add(name, number2);
|
56
|
68
|
test.remove(number);
|
|
69
|
+
|
57
|
70
|
String actual = test.reverseLookup(number);
|
58
|
71
|
assertEquals("N/A", actual);
|
59
|
72
|
}
|
60
|
73
|
|
61
|
74
|
@Test
|
62
|
|
- public void testReverseLookup()
|
|
75
|
+ public void testDisplay()
|
63
|
76
|
{
|
64
|
77
|
PhoneBook test = new PhoneBook();
|
65
|
|
- String phoneNumber = "(302)-867-5309";
|
66
|
|
- String expectedName = "Jenny";
|
67
|
|
- test.add(expectedName, phoneNumber);
|
68
|
|
-
|
69
|
|
- String actual = test.reverseLookup(phoneNumber);
|
70
|
|
- assertEquals(expectedName, actual);
|
71
|
|
-
|
72
|
|
- }
|
73
|
|
-
|
74
|
|
- @Test
|
75
|
|
- public void testDisplay() {
|
76
|
|
- PhoneBook test = new PhoneBook();
|
77
|
78
|
test.add("hey", "302");
|
78
|
79
|
test.add("yo", "521");
|
79
|
80
|
test.add("hey", "498");
|