Advertisement
Alekss33

Untitled

Apr 15th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. package com.company.team.tests;
  2.  
  3. import com.company.team.basicImpl.BoardsImpl;
  4. import com.company.team.basicImpl.MembersImpl;
  5. import com.company.team.basicImpl.Priority;
  6. import com.company.team.basicImpl.Severity;
  7. import com.company.team.basicImpl.workItemsImplementation.BugImpl;
  8. import com.company.team.interfaces.Bug;
  9. import com.company.team.interfaces.other.Board;
  10. import com.company.team.interfaces.other.Member;
  11. import org.junit.Test;
  12.  
  13. public class BugImpl_Should {
  14. private static final Member existingMember = new MembersImpl("Boris");
  15.  
  16. @Test(expected = IllegalArgumentException.class)
  17. public void throwWhenTheNameIsNull() {
  18. Bug board = new BugImpl(null, "description123456789", "Active", Priority.HIGH, existingMember, Severity.CRITICAL);
  19. }
  20.  
  21.  
  22. @Test(expected = IllegalArgumentException.class)
  23. public void throwWhenTheNameIsShort() {
  24. Bug board = new BugImpl("Abc", "description123456789", "Active", Priority.HIGH, existingMember, Severity.CRITICAL);
  25. }
  26.  
  27. @Test(expected = IllegalArgumentException.class)
  28. public void throwWhenTheNameIsLong() {
  29. Bug board = new BugImpl("LongName123456543211234512345654321123451234565432112345123456543211234512345654321123451234565432112345123456543211234512345654321123451234565432112345", "description123456789", "Active", Priority.HIGH, existingMember, Severity.CRITICAL);
  30. }
  31.  
  32.  
  33. @Test(expected = IllegalArgumentException.class)
  34. public void throwWhenTheDescriptionIsNull() {
  35. Bug board = new BugImpl("TaskI", null, "Active", Priority.HIGH, existingMember, Severity.CRITICAL);
  36. }
  37.  
  38.  
  39. @Test(expected = IllegalArgumentException.class)
  40. public void throwWhenTheDescriptionIsShort() {
  41. Bug board = new BugImpl("TaskI", "description", "Active", Priority.HIGH, existingMember, Severity.CRITICAL);
  42. }
  43.  
  44. @Test(expected = IllegalArgumentException.class)
  45.  
  46. public void throwWhenTheDescriptionIsLong() {
  47. Bug board = new BugImpl("TaskI", "description123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  48. , "Active", Priority.HIGH, existingMember, Severity.CRITICAL);
  49. }
  50.  
  51.  
  52. @Test(expected = IllegalArgumentException.class)
  53. public void throwWhenTheStatusIsNull() {
  54. Bug board = new BugImpl("TaskI", "description123456789", null, Priority.HIGH, existingMember, Severity.CRITICAL);
  55. }
  56.  
  57.  
  58. @Test(expected = IllegalArgumentException.class)
  59. public void throwWhenTheStatusIsNotCorrect() {
  60. Bug board = new BugImpl("TaskI", "description123456789", "Activ", Priority.HIGH, existingMember, Severity.CRITICAL);
  61. }
  62.  
  63.  
  64. @Test(expected = IllegalArgumentException.class)
  65. public void throwWhenThePrioriyIsNull() {
  66. Bug board = new BugImpl("TaskI", "description123456789", "Active", null, existingMember, Severity.CRITICAL);
  67. }
  68.  
  69.  
  70. @Test(expected = IllegalArgumentException.class)
  71. public void throwWhenThePriorityIsNotCorrect() {
  72. Bug board = new BugImpl("TaskI", "description123456789", "Fixed", Priority.valueOf("abc"), existingMember, Severity.CRITICAL);
  73. }
  74.  
  75.  
  76. @Test(expected = IllegalArgumentException.class)
  77. public void throwWhenTheMemberIsNull() {
  78. Bug board = new BugImpl("TaskI", "description123456789", "Active", Priority.HIGH, null, Severity.CRITICAL);
  79. }
  80.  
  81. @Test(expected = IllegalArgumentException.class)
  82. public void throwWhenTheSeverityIsNull() {
  83. Bug board = new BugImpl("TaskI", "description123456789", "Active", Priority.LOW, existingMember, null);
  84. }
  85.  
  86.  
  87. @Test(expected = IllegalArgumentException.class)
  88. public void throwWhenTheSeverityIsNotCorrect() {
  89. Bug board = new BugImpl("TaskI", "description123456789", "Fixed", Priority.MEDIUM, existingMember, Severity.valueOf("wrong"));
  90. }
  91.  
  92.  
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement