|
@@ -81,6 +81,33 @@ public class PhoneBookTest {
|
81
|
81
|
}
|
82
|
82
|
|
83
|
83
|
@Test
|
84
|
|
- public void
|
|
84
|
+ public void displayEntirePhoneBookContentsTest(){
|
|
85
|
+ testPhonebook.add("Andrea", "8888");
|
|
86
|
+ testPhonebook.add("Alexei", "8877");
|
|
87
|
+ String actual = testPhonebook.displayEntirePhoneBookContents();
|
|
88
|
+ String expected = "Alexei's phone number: [8877]\nAndrea's phone number: [8888]\n";
|
|
89
|
+ Assert.assertEquals(expected, actual);
|
|
90
|
+ }
|
|
91
|
+
|
|
92
|
+ @Test
|
|
93
|
+ public void addAdditionalNumberTest(){
|
|
94
|
+ testPhonebook.add("Andrea", "8888");
|
|
95
|
+ testPhonebook.personTreeMap.get("Andrea").addAdditionalNumber("1111");
|
|
96
|
+ String actual= testPhonebook.displayEntirePhoneBookContents();
|
|
97
|
+ String expected = "Andrea's phone number(s): [8888, 1111]\n";
|
|
98
|
+ Assert.assertEquals(expected, actual);
|
|
99
|
+
|
|
100
|
+ }
|
|
101
|
+
|
|
102
|
+ @Test
|
|
103
|
+ public void removeSingleNumberTest(){
|
|
104
|
+ testPhonebook.add("Andrea", "8888");
|
|
105
|
+ testPhonebook.personTreeMap.get("Andrea").addAdditionalNumber("1111");
|
|
106
|
+ testPhonebook.personTreeMap.get("Andrea").addAdditionalNumber("2222");
|
|
107
|
+ testPhonebook.personTreeMap.get("Andrea").removeSingleNumber("1111");
|
|
108
|
+ String actual = testPhonebook.displayEntirePhoneBookContents();
|
|
109
|
+ String expected = "Andrea's phone number(s): [8888, 2222]\n";
|
|
110
|
+ Assert.assertEquals(expected, actual);
|
|
111
|
+ }
|
85
|
112
|
|
86
|
113
|
}
|