|
|
@ -50,4 +50,21 @@ public class AspectRatioTest { |
|
|
|
assertEquals(inverse.getX(), 1f, 0); |
|
|
|
assertEquals(inverse.getX(), 1f, 0); |
|
|
|
assertEquals(inverse.getY(), 5f, 0); |
|
|
|
assertEquals(inverse.getY(), 5f, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test(expected = NumberFormatException.class) |
|
|
|
|
|
|
|
public void testParse_notNumbers() { |
|
|
|
|
|
|
|
AspectRatio.parse("a:b"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test(expected = NumberFormatException.class) |
|
|
|
|
|
|
|
public void testParse_noColon() { |
|
|
|
|
|
|
|
AspectRatio.parse("24"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testParse() { |
|
|
|
|
|
|
|
AspectRatio ratio = AspectRatio.parse("16:9"); |
|
|
|
|
|
|
|
assertEquals(ratio.getX(), 16); |
|
|
|
|
|
|
|
assertEquals(ratio.getY(), 9); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|