Build a simple PhoneBook program.

PhoneBookTest.java 930B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. public PhoneBookTest()
  17. {
  18. }
  19. /**
  20. * Sets up the test fixture.
  21. *
  22. * Called before every test case method.
  23. */
  24. @Before
  25. public void setUp()
  26. {
  27. }
  28. /**
  29. * Tears down the test fixture.
  30. *
  31. * Called after every test case method.
  32. */
  33. @After
  34. public void tearDown()
  35. {
  36. }
  37. @ Test
  38. public void Test(){
  39. PhoneBook phone = new PhoneBook();
  40. phone.add("Zebra", "111-222-333");
  41. }
  42. @Test
  43. public void Test1(){
  44. PhoneBook phone1 = new PhoneBook();
  45. phone1.add("Cow", "222-333-444");
  46. }
  47. }