Ejemplo n.º 1
0
 @Test
 public void testProcessAdd() {
   VeryLongInt veryLong = user.process("VeryLongInt 999", new VeryLongInt("0"));
   veryLong = user.process("add 1234", veryLong);
   answer = user.process("add 55555", veryLong).toString();
   assertEquals(answer, "[5, 7, 7, 8, 8]");
 } // method tesProcesstAdd
Ejemplo n.º 2
0
 @Test(expected = NullPointerException.class)
 public void testProcessAddNullVeryLongInt() {
   user.process("add 100", null);
 } // method testProcessAddNullVeryLongInt
Ejemplo n.º 3
0
 @Test(expected = NullPointerException.class)
 public void testProcessNullLine() {
   user.process(null, new VeryLongInt("123"));
 } // method testProcessNullLine
Ejemplo n.º 4
0
 @Test(expected = NoSuchElementException.class)
 public void testProcessLineEmpty() {
   user.process("", new VeryLongInt("123"));
 } // method testProcessLineEmpty
Ejemplo n.º 5
0
 @Test(expected = IllegalArgumentException.class)
 public void testProcessAddNoDigits() {
   user.process("add xyz", new VeryLongInt("500"));
 } // method testProcessAddNoDigits
Ejemplo n.º 6
0
 @Test(expected = IllegalArgumentException.class)
 public void testProcessBad() {
   user.process("subtract 100", new VeryLongInt("500"));
 } // method testProcessBad
Ejemplo n.º 7
0
 @Test(expected = NoSuchElementException.class)
 public void testProcessConstructorEmpty() {
   user.process("VeryLongInt", new VeryLongInt("999"));
 } // method testProcessConstructorEmpty
Ejemplo n.º 8
0
 @Test
 public void testProcessConstructor() {
   answer = user.process("VeryLongInt 100", new VeryLongInt("0")).toString();
   assertEquals(answer, "[1, 0, 0]");
 } // method testProcessConstructor