Build a simple PhoneBook program.

PhoneBookTest.java 715B

123456789101112131415161718192021222324252627282930313233343536
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class PhoneBookTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class PhoneBookTest
  12. {
  13. /**
  14. * Default constructor for test class PhoneBookTest
  15. */
  16. @Test
  17. public void testConstructor()
  18. {
  19. PhoneBook phoneBook = new PhoneBook();
  20. }
  21. @Test
  22. public void testAddingPhoneNumber(){
  23. PhoneBook phoneBook = new PhoneBook();
  24. String name = "Khalil";
  25. String phoneNumber = "215-555-555";
  26. String expected = name + phoneNumber;
  27. phoneBook.AddInput(name,phoneNumber);
  28. }
  29. }