Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. @Test
  2. public void testNotNullLine(){
  3. thrown.expect(NullPointerException.class);
  4. thrown.expectMessage("Line cannot be null");
  5.  
  6. AccountParser.parse(null);
  7. }
  8.  
  9. @Test
  10. public void testTheDatesAreInTheWrongFormat() throws Exception {
  11. thrown.expect(IllegalArgumentException.class);
  12. thrown.expectMessage("Date is invalid format: Ivo Rahov~The Evolution Lie~2016-14-15");
  13.  
  14. AccountParser.parse("Ivo Rahov~The Evolution Lie~2016-14-15");
  15. }
  16.  
  17. @Test
  18. public void testWithNoName() {
  19. thrown.expect(IllegalArgumentException.class);
  20. thrown.expectMessage("Line is invalid format: ~The Evolution Lie~2016-14-15");
  21.  
  22. AccountParser.parse("~The Evolution Lie~2016-14-15");
  23. }
  24.  
  25. @Test
  26. public void testWithNoTitle() {
  27. thrown.expect(IllegalArgumentException.class);
  28. thrown.expectMessage("Line is invalid format: Ivo Rahov~~2016-14-15");
  29.  
  30. AccountParser.parse("Ivo Rahov~~2016-14-15");
  31. }
  32.  
  33. @Test
  34. public void testWithNoDate() {
  35. thrown.expect(IllegalArgumentException.class);
  36. thrown.expectMessage("Line is invalid format: Ivo Rahov~The Evolution Lie~");
  37.  
  38. AccountParser.parse("Ivo Rahov~The Evolution Lie~");
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement