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