public void testCopy() { Block b3 = new Block(1, 3, 10, 6); // random block Block copyb3 = b3.clone(); assertTrue(copyb3.height() == 10); assertFalse(copyb3.height() == 9); assertTrue(copyb3.width() == 4); assertEquals(copyb3.toString(), "Block<(10x4)@[1,3]>"); }
public void testOne() { Block b1 = new Block(0, 0, 0, 0); // 1x1 block assertTrue(b1.height() == 1); assertEquals(b1.toString(), "Block<(1x1)@[0,0]>"); assertTrue(b1.id() == 3); Block b2 = new Block(1, 1, 2, 2); // 2x2 block assertFalse(b2.height() == 5); assertTrue(b2.width() == 2); assertEquals(b2.toString(), "Block<(2x2)@[1,1]>"); assertTrue(b2.id() == 4); Block b3 = new Block(123, 122, 200, 182); // random block assertTrue(b3.height() == 78); assertTrue(b3.width() == 61); assertEquals(b3.toString(), "Block<(78x61)@[123,122]>"); }
public void testConstructor() { Block b = new Block(1, 2, 3, 4); assertTrue(b.height() == 3); assertTrue(b.width() == 3); System.out.println(b); }