14151617181920
Area area; @Before public void setUp() throws Exception { area = new Area(); }
2627282930313233
} @Test public void testAreaNull() { area = new Area(); assertEquals( area.size(), 0 ); }
3334353637383940
} @Test public void testArea() { area = new Area( 5, 5 ); assertEquals( area.size(), 81 ); }
40414243444546
} @Test (expected = ArrayIndexOutOfBoundsException.class) public void testAreaOutSizeN() { area = new Area(0,5); }
46474849505152
} @Test (expected = ArrayIndexOutOfBoundsException.class) public void testAreaOutSizeM() { area = new Area( 5, 0 ); }
84858687888990919293949596
} @Test public void testClone() { Area clone; area.setSize(3, 3); clone = area.clone(); assertEquals( area.size(), clone.size() ); assertArrayEquals(area.getArray(), clone.getArray()); }
102103104105106107108109
} @Test (expected = ArrayIndexOutOfBoundsException.class) public void testSetStartPointOutSizeN() { area = new Area( 5, 5 ); area.setStartPoint( 5, 4 ); }
109110111112113114115116
} @Test (expected = ArrayIndexOutOfBoundsException.class) public void testSetStartPointOutSizeM() { area = new Area( 5, 5 ); area.setStartPoint( 4, 5 ); }
116117118119120121122123
} @Test (expected = ArrayIndexOutOfBoundsException.class) public void testSetStartPointOutSize_m() { area = new Area( 5, 5 ); area.setStartPoint( 4, -1 ); }
123124125126127128129130
} @Test (expected = ArrayIndexOutOfBoundsException.class) public void testSetStartPointOutSize_n() { area = new Area( 5, 5 ); area.setStartPoint( -1, 4 ); }