Example #1
0
 @Test
 public void sumatorSum() throws Exception {
   Sumator sumator = new Sumator();
   String x = sumator.sum("5", "6");
   int y = Integer.parseInt(x);
   assertThat(y, is(11));
 }
Example #2
0
 @Test
 public void sumNegativeNumbers() throws Exception {
   Sumator sumator = new Sumator();
   String x = sumator.sum("-11", "-29");
   int y = Integer.parseInt(x);
   assertThat(y, is(-40));
 }
Example #3
0
 @Test(expected = InvalidInputException.class)
 public void maxNegative() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("-223748364745645673577", "2");
 }
Example #4
0
 @Test(expected = InvalidInputException.class)
 public void maxPositive() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("223748345637357567456477", "2");
 }
Example #5
0
 @Test(expected = IllegalArgumentException.class)
 public void inputNull() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("", "");
 }
Example #6
0
 @Test(expected = InvalidInputException.class)
 public void invalidInput() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("5safsdghdfsghfg", "6");
 }