|
@@ -1,21 +1,21 @@
|
1
|
1
|
package com.zipcodewilmington.phonebook;
|
2
|
2
|
|
3
|
|
-
|
|
3
|
+import java.util.ArrayList;
|
4
|
4
|
import org.junit.Assert;
|
5
|
5
|
import org.junit.Test;
|
6
|
6
|
|
7
|
7
|
public class TestPerson {
|
8
|
8
|
|
9
|
|
- @Test
|
10
|
|
-
|
11
|
9
|
|
12
|
10
|
|
13
|
11
|
|
14
|
12
|
|
15
|
13
|
@Test
|
16
|
14
|
public void testGetName() {
|
17
|
|
- Person person = new Person("Nathaniel", "8567744773");
|
|
15
|
+ //we place the expected on top
|
18
|
16
|
String expected = "Nathaniel";
|
|
17
|
+ Person person = new Person("Nathaniel", expected);
|
|
18
|
+
|
19
|
19
|
|
20
|
20
|
//I don't need a setter, because i did "this.name"...remember
|
21
|
21
|
String actual = person.getName();
|
|
@@ -24,16 +24,26 @@ public class TestPerson {
|
24
|
24
|
}
|
25
|
25
|
|
26
|
26
|
@Test
|
27
|
|
- public void testGetNumber(){
|
28
|
|
- Person person = new Person("Nathaniel", "8567744773");
|
|
27
|
+ public void testGetPhoneNumbers(){
|
29
|
28
|
String expected = "8567744773";
|
|
29
|
+ Person person = new Person("Nathaniel",expected);
|
|
30
|
+
|
30
|
31
|
|
31
|
|
- String actual = person.getNumber();
|
|
32
|
+ ArrayList<String> actual = person.getPhoneNumbers();
|
32
|
33
|
Assert.assertEquals(expected, actual);
|
33
|
34
|
}
|
34
|
35
|
|
|
36
|
+ @Test
|
|
37
|
+ public void testSetAddAdditionalNumbers(){
|
|
38
|
+ //Given
|
|
39
|
+ String expected = "Karen";
|
|
40
|
+
|
|
41
|
+ //When
|
|
42
|
+ person.setPhoneNumbers(expected);
|
35
|
43
|
|
36
|
44
|
|
|
45
|
+ }
|
|
46
|
+
|
37
|
47
|
|
38
|
48
|
|
39
|
49
|
|