Methods Summary |
---|
public static void | main(java.lang.String[] args)
junit.textui.TestRunner.run(suite());
//junit.swingui.TestRunner.run(suite());
|
private void | nyi()
fail("Not yet implemented");
|
protected void | setUp()
|
public static junit.framework.Test | suite()
TestSuite suite = new TestSuite(ShifterTest.class);
return suite;
|
protected void | tearDown()
|
public void | testCreate()
final Shifter s = new Shifter(new String[]{"element1"});
|
public void | testImpossibleLeftShift()
try {
final String[] s = new String[]{};
final Shifter sh = new Shifter(s);
final Object r = sh.shiftLeft();
fail("Should have thrown IllegalStateException, but didn't, hence test fails");
}
catch(Exception e){}
|
public void | testRightLeftShiftFromEmpty()
final Object[] s = new Object[]{};
final Shifter ss = new Shifter(s);
ss.shiftRight(new Object());
ss.shiftLeft();
assertEquals(ss.state().length, 0);
|
public void | testShiftLeftOne()
final String one = "one";
final String[] s = new String[]{one};
final Shifter sh = new Shifter(s);
final Object r = sh.shiftLeft();
assertEquals(one, r);
|
public void | testShiftRightFromTwo()
final Object[] s = new Object[]{new Object(), new Object()};
final Shifter sh = new Shifter(s);
final String add = "8";
sh.shiftRight(add);
assertEquals(sh.state().length, 3);
|
public void | testShiftRightOne()
final String[] s = new String[]{"one"};
final Shifter sh = new Shifter(s);
final String add = "8";
sh.shiftRight(add);
assertEquals(sh.state().length, 2);
|
public void | testShiftRightOneFromEmpty()
final String[] s = new String[]{};
final Shifter sh = new Shifter(s);
final String add = "8";
sh.shiftRight(add);
assertEquals(sh.state().length, 1);
|