|
@@ -1,5 +1,7 @@
|
1
|
1
|
import org.junit.Assert;
|
2
|
2
|
import org.junit.Test;
|
|
3
|
+import java.util.Map;
|
|
4
|
+import java.util.TreeMap;
|
3
|
5
|
|
4
|
6
|
/**
|
5
|
7
|
* The test class PhoneBookTest.
|
|
@@ -35,9 +37,32 @@ public class PhoneBookTest
|
35
|
37
|
Assert.assertEquals(0, phoneBook.size());
|
36
|
38
|
}
|
37
|
39
|
|
38
|
|
- public String lookUp(){
|
39
|
|
- return null;
|
40
|
|
- }
|
|
40
|
+
|
41
|
41
|
|
|
42
|
+ @Test
|
|
43
|
+ public void lookUp(){
|
|
44
|
+ PhoneBook phoneBook = new PhoneBook();
|
|
45
|
+ String name = "Zebra";
|
|
46
|
+ String expected = "111-222-333";
|
|
47
|
+ phoneBook.addEntry(name,expected);
|
|
48
|
+ //when
|
|
49
|
+ String actual = phoneBook.lookUp(name);
|
|
50
|
+ //then
|
|
51
|
+ Assert.assertEquals(expected,actual);
|
|
52
|
+ }
|
42
|
53
|
|
|
54
|
+ @Test
|
|
55
|
+ public void reverseLoopUp(){
|
|
56
|
+ PhoneBook phoneBook = new PhoneBook();
|
|
57
|
+ String phoneNumber = "111-222-333";
|
|
58
|
+ String expected = "Zebra";
|
|
59
|
+ //when
|
|
60
|
+ // String actual = phoneBook.reverseLookUp(phoneNumber);
|
|
61
|
+ //then
|
|
62
|
+ // Assert.assertEquals(expected,actual);
|
|
63
|
+ }
|
|
64
|
+
|
|
65
|
+ @Test
|
|
66
|
+ public void display(){
|
|
67
|
+ }
|
43
|
68
|
}
|