|
@@ -1,42 +1,19 @@
|
1
|
|
-
|
2
|
|
-
|
3
|
1
|
import static org.junit.Assert.*;
|
4
|
|
-import org.junit.After;
|
5
|
|
-import org.junit.Before;
|
6
|
2
|
import org.junit.Test;
|
|
3
|
+import java.util.ArrayList;
|
7
|
4
|
|
8
|
|
-/**
|
9
|
|
- * The test class PhoneBookTest.
|
10
|
|
- *
|
11
|
|
- * @author (your name)
|
12
|
|
- * @version (a version number or a date)
|
13
|
|
- */
|
14
|
5
|
public class PhoneBookTest
|
15
|
|
-{
|
16
|
|
- /**
|
17
|
|
- * Default constructor for test class PhoneBookTest
|
18
|
|
- */
|
19
|
|
- public PhoneBookTest()
|
20
|
|
- {
|
21
|
|
- }
|
22
|
|
-
|
23
|
|
- /**
|
24
|
|
- * Sets up the test fixture.
|
25
|
|
- *
|
26
|
|
- * Called before every test case method.
|
27
|
|
- */
|
28
|
|
- @Before
|
29
|
|
- public void setUp()
|
30
|
|
- {
|
|
6
|
+{
|
|
7
|
+ @Test
|
|
8
|
+ public void addEntryTest(){
|
|
9
|
+ PhoneBook newEntry = new PhoneBook();
|
|
10
|
+ newEntry.addEntry("Rachelle","123-4567");
|
|
11
|
+ Entry actual = newEntry.getEntry("Rachelle");
|
|
12
|
+ assertEquals("123-4567",actual.getPhoneNumber());
|
31
|
13
|
}
|
32
|
14
|
|
33
|
|
- /**
|
34
|
|
- * Tears down the test fixture.
|
35
|
|
- *
|
36
|
|
- * Called after every test case method.
|
37
|
|
- */
|
38
|
|
- @After
|
39
|
|
- public void tearDown()
|
40
|
|
- {
|
|
15
|
+ @Test
|
|
16
|
+ public void hasEntryTest(){
|
|
17
|
+
|
41
|
18
|
}
|
42
|
19
|
}
|