|
@@ -1,92 +1,31 @@
|
1
|
1
|
package com.zipcodewilmington.phonebook;
|
2
|
2
|
|
|
3
|
+import org.junit.Assert;
|
3
|
4
|
import org.junit.Test;
|
|
5
|
+
|
|
6
|
+import java.util.TreeMap;
|
|
7
|
+
|
4
|
8
|
/**
|
5
|
9
|
* Created by leon on 1/23/18.
|
6
|
10
|
*/
|
7
|
11
|
public class PhoneBookTest {
|
8
|
12
|
|
9
|
13
|
@Test
|
10
|
|
- public void testSetAddName() {
|
11
|
|
- PhoneBook testing = new PhoneBook();
|
12
|
|
- String expected = "Nathaniel";
|
13
|
|
-
|
14
|
|
- testing.setAddName(expected);
|
15
|
|
-
|
16
|
|
- String actual = testing.getAddName();
|
17
|
|
- Assert.assertEquals(expected, actual);
|
18
|
|
-
|
19
|
|
-
|
20
|
|
- }
|
21
|
|
-
|
22
|
|
-
|
23
|
|
- @Test
|
24
|
|
- public void testSetAddNumber() {
|
25
|
|
- PhoneBook testing = new PhoneBook();
|
26
|
|
- String expected = "8567744733";
|
27
|
|
-
|
28
|
|
- testing.setAddNumber(expected);
|
29
|
|
-
|
30
|
|
- String actual = testing.getAddNumber();
|
31
|
|
- Assert.assertEquals(expected, actual);
|
32
|
|
- }
|
33
|
|
-
|
34
|
|
- @Test
|
35
|
|
- public void testSetLookup() {
|
36
|
|
- PhoneBook testing = new PhoneBook();
|
37
|
|
- String expected = "Samantha";
|
38
|
|
-
|
39
|
|
- testing.setLookup(expected);
|
40
|
|
-
|
41
|
|
- String actual = testing.getLookup();
|
42
|
|
- Assert.assertEquals(expected, actual);
|
43
|
|
- }
|
44
|
|
-
|
45
|
|
- @Test
|
46
|
|
- public void testSetRemoveName() {
|
47
|
|
- Phonebook testing = new PhoneBook();
|
48
|
|
- String expected = "Removal";
|
49
|
|
-
|
50
|
|
- testing.setRemoveName(expected);
|
51
|
|
-
|
52
|
|
- String actual = testing.getRemoveName();
|
53
|
|
- Assert.assertEquals(expected, actual);
|
54
|
|
- }
|
55
|
|
-
|
56
|
|
- @Test
|
57
|
|
- public void testSetRemoveNumber() {
|
58
|
|
- PhoneBook testing = new PhoneBook();
|
59
|
|
- String expected = "Remove Number";
|
60
|
|
-
|
61
|
|
- testing.setRemoveNumber(expected);
|
62
|
|
-
|
63
|
|
- String actual = testing.getRemoveNumber();
|
64
|
|
- Assert.assertEquals(expected, actual);
|
65
|
|
- }
|
66
|
|
-
|
67
|
|
- @Test
|
68
|
|
- public void testSetListNames() {
|
69
|
|
- PhoneBook testing = new PhoneBook();
|
70
|
|
- String expected = "List of Names";
|
|
14
|
+ public void LookupTest(){
|
|
15
|
+ //Given
|
|
16
|
+ String expectedname = "Katrice";
|
|
17
|
+ String expectednumber = "8567744773";
|
|
18
|
+ //When
|
|
19
|
+ PhoneBook phonebook = new PhoneBook();
|
|
20
|
+ //Then
|
|
21
|
+ //String actualnamephonebook = phonebook.treemap.getKey();
|
|
22
|
+ //String actualnumberphonebook = phonebook.treemap.getKey();
|
71
|
23
|
|
72
|
|
- testing.setListNames(expected);
|
73
|
24
|
|
74
|
|
- String actual = testing.getListNames();
|
75
|
|
- Assert.assertEquals(expected, actual);
|
|
25
|
+ String actualnumber = phonebook.getNumber();
|
|
26
|
+ Assert.assertEquals(expectednumber, actualnumber);
|
76
|
27
|
}
|
77
|
28
|
|
78
|
|
- @Test
|
79
|
|
- public void testSetListNumber() {
|
80
|
|
- PhoneBook person = new PhoneBook();
|
81
|
|
- String expected = "List Number";
|
82
|
|
-
|
83
|
|
- person.setListNumber(expected);
|
84
|
|
-
|
85
|
|
- String actual = person.getListNumber();
|
86
|
|
- Assert.assertEquals(expected, actual);
|
87
|
|
- }
|
88
|
|
-
|
89
|
|
-
|
90
|
29
|
|
91
|
30
|
|
92
|
31
|
}
|