Пример #1
0
  @Test
  public void test() {
    // fail("Not yet implemented");

    int data = obj.calculate(3, 24);
    assertEquals(data, 27);
    assertNotNull(data);
  }
Пример #2
0
 @Test
 public void graterThan1000isIgnored() throws Exception {
   assertEquals(calculator.calculate("1,1,1001"), 2);
 }
Пример #3
0
 @Test(expected = Exception.class)
 public void negativeReturnsException() throws Exception {
   calculator.calculate("-1");
 }
Пример #4
0
 @Test
 public void threeNumbersDelimitedBothWayReturnsSum() throws Exception {
   assertEquals(calculator.calculate("1,2,3"), 6);
 }
Пример #5
0
 @Test
 public void twoNumbersNewLineDelimitedReturnSum() throws Exception {
   assertEquals(calculator.calculate("1\n2"), 3);
 }
Пример #6
0
 @Test
 public void twoNumbersReturnsSum() throws Exception {
   assertEquals(calculator.calculate("1,2"), 3);
 }
Пример #7
0
 @Test
 public void singleValueIsReplied() throws Exception {
   assertEquals(calculator.calculate("1"), 1);
 }
Пример #8
0
 @Test
 public void emptyStringReturnsZero() throws Exception {
   assertEquals(calculator.calculate(""), 0);
 }