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