BAEL-3517: Code Review Feedback Applied
This commit is contained in:
parent
369e95b8ca
commit
60880ad401
|
@ -3,7 +3,6 @@
|
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>java-numbers-3</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>java-numbers-3</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
@ -13,7 +12,6 @@
|
|||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-java</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
<build>
|
||||
<finalName>java-numbers-3</finalName>
|
||||
|
|
|
@ -9,28 +9,46 @@ public class DoubleToLongUnitTest {
|
|||
|
||||
@Test
|
||||
public void givenDoubleValue_whenLongValueCalled_thenLongValueReturned() {
|
||||
Assert.assertEquals(9999L, Double.valueOf(VALUE)
|
||||
.longValue());
|
||||
Assert.assertEquals(9999L, Double.valueOf(VALUE).longValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenMathRoundUseds_thenLongValueReturned() {
|
||||
public void givenDoubleValue_whenMathRoundUsed_thenLongValueReturned() {
|
||||
Assert.assertEquals(10000L, Math.round(VALUE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenMathRoundUsed_thenRoundDown() {
|
||||
Assert.assertEquals(9999L, Math.round(9999.444));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenMathCeilUsed_thenLongValueReturned() {
|
||||
Assert.assertEquals(10000L, Math.ceil(VALUE), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenMathCeilUsed_thenSameValueReturned() {
|
||||
Assert.assertEquals(9999L, Math.ceil(9999.0), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenMathCeilUsed_thenDifferentThanRound() {
|
||||
Assert.assertEquals(10000L, Math.ceil(9999.444), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenMathFloorUsed_thenLongValueReturned() {
|
||||
Assert.assertEquals(9999L, Math.floor(VALUE), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenMathFloorUsed_thenSameValueReturned() {
|
||||
Assert.assertEquals(9999L, Math.floor(9999.0), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenDoubleValue_whenTypeCasted_thenLongValueReturned() {
|
||||
Assert.assertEquals(9999L, (long) VALUE);
|
||||
}
|
||||
|
||||
}
|
2
pom.xml
2
pom.xml
|
@ -511,6 +511,7 @@
|
|||
<module>java-math-2</module> <!-- Added for BAEL-3506 -->
|
||||
<module>java-numbers</module>
|
||||
<module>java-numbers-2</module>
|
||||
<module>java-numbers-3</module>
|
||||
<module>java-rmi</module>
|
||||
<module>java-spi</module>
|
||||
<module>java-vavr-stream</module>
|
||||
|
@ -1144,6 +1145,7 @@
|
|||
<module>java-math-2</module> <!-- Added for BAEL-3506 -->
|
||||
<module>java-numbers</module>
|
||||
<module>java-numbers-2</module>
|
||||
<module>java-numbers-3</module>
|
||||
<module>java-rmi</module>
|
||||
<module>java-spi</module>
|
||||
<module>java-vavr-stream</module>
|
||||
|
|
Loading…
Reference in New Issue