Advertisement
Guest User

Untitled

a guest
May 3rd, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. import static org.junit.Assert.*;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import org.junit.Ignore;
  6. import org.junit.Test;
  7.  
  8.  
  9. public class CompanyProjectTests {
  10.  
  11. @Ignore
  12. public void test1() {
  13. //Test 8 GEt project ID
  14. //Testing Getting Project ID, Should be one as first project created.
  15. CompanyProject project = new CompanyProject();
  16. assertEquals(1,project.getPID());
  17. }
  18. @Ignore
  19. public void test2() {
  20. //Test 13 Get contact function
  21. //Testing a string that wont be in the arraylist
  22. CompanyProject project2 = new CompanyProject();
  23. assertEquals(false,project2.isContact("not an email"));
  24. }
  25.  
  26. @Ignore
  27. public void test3() {
  28. //Test 14 (TEST WRONG ON PDF EXPECTED OUT COME SHOULD BE TRUE)
  29. //Testing a string that wont be in the arraylist
  30. CompanyProject project3 = new CompanyProject();
  31. project3.addContact("jameswilliams@gmail.com");
  32. assertTrue(project3.isContact("jameswilliams@gmail.com"));
  33. }
  34.  
  35. @Ignore
  36. public void test4() {
  37. //Test 15
  38. //Already tested in test 14
  39. }
  40.  
  41. @Ignore
  42. public void test5() {
  43. //Test 22 TEST NOT WORKING DONT UNDERSTAND ARRAYLISTS
  44. //Tests that the arraylist contains the correct emails for that phase
  45. // Get emails for current phase
  46. ArrayList<CompanyEmail> test = new ArrayList<CompanyEmail>();
  47. CompanyEmail email = new CompanyEmail("from@mail.caom","to@mail.com" , "subline", "message");
  48. CompanyProject project5 = new CompanyProject();
  49. project5.addEmail(email);
  50. //project5.addContact("jameswilliams2@gmail.com");
  51. //project5.addContact("jameswilliams3@gmail.com");
  52.  
  53. test.add(email);
  54. //test.add("jameswilliams2@gmail.com");
  55. //test.add("jameswilliams3@gmail.com");
  56.  
  57.  
  58. assertEquals(test,project5.getEmailsForPhase());
  59. }
  60.  
  61. @Ignore
  62. public void test6() {
  63. //Test 23 CANT DO TEST
  64. }
  65.  
  66. @Ignore
  67. public void test7() {
  68. //Test 30 Get phase Name
  69. //getting phase name
  70. //Written by Matthew and Marek
  71. // made and object for email system to create the array of phase names to test if project had the correct phase name
  72. CompanyProject project7 = new CompanyProject();
  73. CompanyEmailSystem system = new CompanyEmailSystem();
  74. assertEquals(project7.getPhaseByName(),system.ProjectPhases[1]);
  75. }
  76.  
  77. @Ignore
  78. public void test8() {
  79. //Test 31 Get phase Name
  80. //getting phase name
  81. //Written by Matthew and Marek
  82. //Done test in test 30
  83. }
  84.  
  85. @Test
  86. public void test9() {
  87. //Test 34 toString Overdrive
  88. //tests that it corectly converts the project name and current phase to a single string.
  89. //Written by Matthew
  90. CompanyProject project9 = new CompanyProject();
  91. //System.out.println(project9.toString());
  92. assertEquals("New Project [Design]",project9.toString());
  93. }
  94.  
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement