Changeset 8262 in josm for trunk/test/unit
- Timestamp:
- 2015-04-25T15:44:33+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/util/RotationAngleTest.java
r8251 r8262 9 9 10 10 @Test 11 public void testParseRad() throws Exception {12 assertThat(RotationAngle.buildStaticRotation("0.54rad").getRotationAngle(null), is(0.54));13 assertThat(RotationAngle.buildStaticRotation("1.").getRotationAngle(null), is(1.));14 }15 16 @Test17 public void testParseDeg() throws Exception {18 assertThat(RotationAngle.buildStaticRotation("180°").getRotationAngle(null), is(Math.PI));19 assertThat(RotationAngle.buildStaticRotation("90deg").getRotationAngle(null), is(Math.PI / 2));20 }21 22 @Test23 public void testParseGrad() throws Exception {24 assertThat(RotationAngle.buildStaticRotation("200grad").getRotationAngle(null), is(Math.PI));25 assertThat(RotationAngle.buildStaticRotation("100grad").getRotationAngle(null), is(Math.PI / 2));26 assertThat(RotationAngle.buildStaticRotation("400grad").getRotationAngle(null), is(Math.PI * 2));27 }28 29 @Test30 public void testParseTurn() throws Exception {31 assertThat(RotationAngle.buildStaticRotation("0.5turn").getRotationAngle(null), is(Math.PI));32 assertThat(RotationAngle.buildStaticRotation("0.25turn").getRotationAngle(null), is(Math.PI / 2));33 assertThat(RotationAngle.buildStaticRotation("1turn").getRotationAngle(null), is(Math.PI * 2));34 }35 36 @Test37 11 public void testParseCardinal() throws Exception { 38 12 assertThat(RotationAngle.buildStaticRotation("south").getRotationAngle(null), is(Math.PI)); … … 43 17 @Test(expected = IllegalArgumentException.class) 44 18 public void testParseFail() throws Exception { 45 RotationAngle.buildStaticRotation(" 0.54bad");19 RotationAngle.buildStaticRotation("bad"); 46 20 } 47 21
Note:
See TracChangeset
for help on using the changeset viewer.