1 package jester.acceptancetests; 2 3 public class VeryTested { 4 public VeryTested() { 5 super(); 6 } 7 public boolean mustBeEqual() { 8 String a = "hi"; 9 return a == a; 10 } 11 public int mustDecrement(int aNum) { 12 return --aNum; 13 } 14 public int mustIncrement(int aNum) { 15 return ++aNum; 16 } 17 public boolean mustNotBeEqual() { 18 return new Object () != new Object (); 19 } 20 public int mustReturnOne() { 21 return 1; 22 } 23 public boolean mustReturnTrue() { 24 return true; 25 } 26 public int mustTakeCorrectBranchFor(boolean condition) { 27 if (condition) { 28 return 1; 29 } else { 30 return 0; 31 } 32 } 33 public void turnIntoInfiniteLoop() { 34 long total = 0; 35 for (int i = 0; i < 10; i++) { 36 total += i; 37 } 38 System.out.println("ignore this - " + total); 39 } 40 } | Popular Tags |