Changeset 8857 in josm for trunk/test/unit/org/openstreetmap/josm/gui/util
- Timestamp:
- 2015-10-11T17:28:19+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/util/RotationAngleTest.java
r8624 r8857 2 2 package org.openstreetmap.josm.gui.util; 3 3 4 import static org.hamcrest.CoreMatchers.is; 5 import static org.junit.Assert.assertThat; 4 import static org.junit.Assert.assertEquals; 6 5 7 6 import org.junit.Test; 8 7 8 /** 9 * Unit tests of {@link RotationAngle} class. 10 */ 9 11 public class RotationAngleTest { 10 12 13 private static final double EPSILON = 1e-11; 14 11 15 @Test 12 public void testParseCardinal() throws Exception{13 assert That(RotationAngle.buildStaticRotation("south").getRotationAngle(null),is(Math.PI));14 assert That(RotationAngle.buildStaticRotation("s").getRotationAngle(null),is(Math.PI));15 assert That(RotationAngle.buildStaticRotation("northwest").getRotationAngle(null),is(Math.toRadians(315)));16 public void testParseCardinal() { 17 assertEquals(Math.PI, RotationAngle.buildStaticRotation("south").getRotationAngle(null), EPSILON); 18 assertEquals(Math.PI, RotationAngle.buildStaticRotation("s").getRotationAngle(null), EPSILON); 19 assertEquals(Math.toRadians(315), RotationAngle.buildStaticRotation("northwest").getRotationAngle(null), EPSILON); 16 20 } 17 21 18 22 @Test(expected = IllegalArgumentException.class) 19 public void testParseFail() throws Exception{23 public void testParseFail() { 20 24 RotationAngle.buildStaticRotation("bad"); 21 25 } 22 26 23 27 @Test(expected = NullPointerException.class) 24 public void testParseNull() throws Exception{28 public void testParseNull() { 25 29 RotationAngle.buildStaticRotation(null); 26 30 }
Note:
See TracChangeset
for help on using the changeset viewer.