1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import org.junit.Assert;
- import org.junit.Test;
-
- /**
- * The test class PhoneBookTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class PhoneBookTest
- {
- @Test
- public void addEntryTest(){
- //Given
- PhoneBook phoneBook = new PhoneBook();
- String name = "Zebra";
- String phoneNumber = "111-222-333";
- String expected = "Zebra , 111-222-333";
- //When
- phoneBook.addEntry(name,phoneNumber);
-
- //Then
- Assert.assertEquals(1,phoneBook.size());
-
- }
- @Test
- public void removeEntry(){
- //Given
- PhoneBook phoneBook = new PhoneBook();
- String name = "Zebra";
- String expected = "";
- //when
- phoneBook.removeEntry(name);
- //Then
- Assert.assertEquals(0, phoneBook.size());
- }
-
- public String lookUp(){
- return null;
- }
-
-
- }
|