예제 #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));
 }
예제 #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));
 }
예제 #3
0
 @Test(expected = InvalidInputException.class)
 public void maxNegative() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("-223748364745645673577", "2");
 }
예제 #4
0
 @Test(expected = InvalidInputException.class)
 public void maxPositive() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("223748345637357567456477", "2");
 }
예제 #5
0
 @Test(expected = IllegalArgumentException.class)
 public void inputNull() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("", "");
 }
예제 #6
0
 @Test(expected = InvalidInputException.class)
 public void invalidInput() throws Exception {
   Sumator sumator = new Sumator();
   sumator.sum("5safsdghdfsghfg", "6");
 }