@@ -0,0 +1,1754 @@
+package nl.tudelft.dnainator.annotation;%0A%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0A%0A/**%0A * Tests the %7B@link Range%7D used for annotations.%0A */%0Apublic class RangeTest %7B%0A%0A%09/**%0A%09 * Tests if the Range is created properly.%0A%09 */%0A%09@Test%0A%09public void testCreation() %7B%0A%09%09Range r = new Range(0, 1);%0A%09%09assertEquals(0, r.getX());%0A%09%09assertEquals(1, r.getY());%0A%09%7D%0A%0A%09/**%0A%09 * Tests if the returned range has an inclusive start coordinate and an exclusive end%0A%09 * coordinate.%0A%09 */%0A%09@Test%0A%09public void testGetExclusiveEnd() %7B%0A%09%09Range r = new Range(0, 1);%0A%09%09Range exclusiveEndRange = new Range(0, 0);%0A%09%09assertEquals(exclusiveEndRange, r.getExclusiveEnd());%0A%09%7D%0A%0A%09/**%0A%09 * Tests if comparing ranges yields the correct outcome.%0A%09 */%0A%09@Test%0A%09public void testCompareTo() %7B%0A%09%09//CHECKSTYLE.OFF: MagicNumber%0A%09%09Range normal = new Range(3, 5);%0A%09%09Range larger = new Range(6, 10);%0A%09%09Range smaller = new Range(1, 2);%0A%09%09Range equal = new Range(3, 5);%0A%09%09Range overlap = new Range(1, 6);%0A%09%09//CHECKSTYLE.ON: MagicNumber%0A%0A%09%09assertEquals(1, normal.compareTo(smaller));%0A%09%09assertEquals(-1, normal.compareTo(larger));%0A%09%09assertEquals(0, normal.compareTo(equal));%0A%09%09assertEquals(0, normal.compareTo(overlap));%0A%09%7D%0A%0A%09/**%0A%09 * Tests if equals() and hashCode() work correctly.%0A%09 */%0A%09@Test%0A%09public void testEqualsAndHashCode() %7B%0A%09%09//CHECKSTYLE.OFF: MagicNumber%0A%09%09Range r = new Range(0, 1);%0A%09%09Range r2 = new Range(4, 5);%0A%09%09//CHECKSTYLE.ON: MagicNumber%0A%09%09assertFalse(r.equals(null));%0A%09%09assertFalse(r.equals(r2));%0A%09%09assertFalse(r.equals(new Object()));%0A%09%09assertEquals(r.hashCode(), r2.hashCode());%0A%09%7D%0A%0A%09/**%0A%09 * Test toString().%0A%09 */%0A%09@Test%0A%09public void testToString() %7B%0A%09%09assertEquals(%22from: 0, to: 1%22, new Range(0, 1).toString());%0A%09%7D%0A%7D%0A

Add RangeTest