123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- public class PhoneBookTest
- {
-
- @Before
- public void setUp(){
- PhoneBook pb = new PhoneBook();
- }
-
- @Test
- public void testAdd1(){
- PhoneBook pb = new PhoneBook();
-
- String expected = "123, 456";
-
- pb.addEntrant("John" , "123", "456");
- String actual = pb.lookup("John");
-
- assertEquals(expected, actual);
- }
-
- @Test
- public void testAdd2(){
- PhoneBook pb = new PhoneBook();
-
- String expected = "123";
-
- pb.addEntrant("Josh" , "123");
- String actual = pb.lookup("Josh");
-
- assertEquals(expected, actual);
- }
-
-
- @Test
- public void testRemove(){
- PhoneBook pb = new PhoneBook();
-
- String expected = null;
-
- pb.addEntrant("Josh" , "123");
- pb.removeEntrant("Josh");
- String actual = pb.lookup("Josh");
-
- assertEquals(expected, actual);
-
- }
-
- @Test
- public void testLookup(){
- PhoneBook pb = new PhoneBook();
-
- String expected = "123, 456, 789";
-
- pb.addEntrant("Josh" , "123", "456", "789");
- String actual = pb.lookup("Josh");
-
- assertEquals(expected, actual);
- }
-
- @Test
- public void testReverseLookup(){
-
-
- }
-
-
- }
|