1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class PhoneBookTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class PhoneBookTest
- {
- PhoneBook pb = new PhoneBook();
-
- @Test
- public void PhoneBookAdd(){
- String expected = "bobo 333666444";
-
- String actual = pb.add("bobo", "333666444");
-
- assertEquals(expected, actual);
- }
-
- @Test
- public void PhoneBookRemove(){
- String expected = "anything";
-
- String actual = pb.remove("anything");
-
- assertEquals(expected, actual);
-
- }
-
- @Test
- public void PhoneBookLookUp(){
- //when
- pb.add("fufu", "8888888");
-
- //expected
- String expected = "8888888";
-
- //actual
- String actual = pb.lookUp("fufu");
-
- assertEquals(expected, actual);
-
- }
-
- @Test
- public void reverseLookUp(){
- //when
- pb.add("buu", "89898989");
-
- String expected = "buu";
-
- String actual = pb.reverseLookup("89898989");
-
- assertEquals(expected, actual);
- }
-
- @Test
- public void DisplayTest(){
- //when
-
- }
-
- }
|