12131415161718
public class SizeRTest { SizeR sr; public SizeRTest() { sr = new SizeR(1, 2); }
2223242526272829
assertTrue(sr.getCX() == 1 & sr.getCY() == 2); } @Test public void testCopyConstructor() { SizeR sr2 = new SizeR(sr); assertTrue(sr2.getCX() == sr.getCX() && sr2.getCY() == sr2.getCY()); }
3334353637383940
assertTrue(sr.getWidth() == sr.getCX() && sr.getHeight() == sr.getCY()); } @Test public void testEquals() { SizeR sr2 = new SizeR(1, 2); assertTrue(sr2.equals(sr) && sr.equals(sr2)); }
3940414243444546
assertTrue(sr2.equals(sr) && sr.equals(sr2)); } @Test public void testUnequal() { SizeR sr2 = new SizeR(2, 4); assertFalse(sr2.equals(sr)); }