1234567891011121314151617181920212223242526272829303132333435363738 |
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- public class PhoneBookTest
- {
- @Test
- public void testAdd(){
- PhoneBook phonebook = new PhoneBook();
- String expected = "1234567890";
- phonebook.add("tyler",expected);
- String actual = phonebook.lookUp("tyler");
- assertEquals(actual, expected);
-
- }
-
- @Test
- public void testLookUp(){
- PhoneBook phonebook = new PhoneBook();
- String expected = "1234567890";
- phonebook.add("tyler", expected);
- String actual = phonebook.lookUp("tyler");
- assertEquals(expected, actual);
- }
-
- @Test
- public void testReverse(){
- PhoneBook phonebook = new PhoneBook();
- String expected = "tyler";
- phonebook.add("tyler", "1234567890");
- String actual = phonebook.reverseLookUp("1234567890");
- assertEquals(expected, actual);
- }
-
- }
|