示例#1
0
 public @Test void addEmptyStringReturns0() {
   Assert.assertEquals(0, calc.add(""));
 }
示例#2
0
 public static void main(String[] args) {
   int result = Calc.add(1, 2);
   System.out.println("result=" + result);
 }
示例#3
0
 public @Test void addWithLotsOfValuesReturnsTheirSum() {
   Assert.assertEquals(18, calc.add("1,2,3,0,10,2,0"));
 }
示例#4
0
 public @Test void addWithThreeValuesReturnsTheirSum() {
   Assert.assertEquals(0, calc.add("0,0,0"));
   Assert.assertEquals(4, calc.add("0,1,3"));
   Assert.assertEquals(6, calc.add("1,2,3"));
 }
示例#5
0
 public @Test void addWithTwoValuesReturnsTheirSum() {
   Assert.assertEquals(0, calc.add("0,0"));
   Assert.assertEquals(1, calc.add("0,1"));
   Assert.assertEquals(3, calc.add("1,2"));
 }
示例#6
0
 public @Test void addStringWithOneValueReturnsTheValue() {
   Assert.assertEquals(0, calc.add("0"));
   Assert.assertEquals(1, calc.add("1"));
   Assert.assertEquals(3, calc.add("3"));
 }
示例#7
0
 @Test
 public void testAdd() {
   //		assertTrue("Right", , ));
   assertFalse("fdsfds", 67 == c.add(2, 5));
 }