File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
src/test/java/org/javamoney/moneta Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1167,4 +1167,19 @@ public void testDivide_WrongCurrency() {
11671167 Money m2 = Money .of (BigDecimal .TEN , "CHF" );
11681168 m1 .subtract (m2 );
11691169 }
1170+
1171+ @ Test (expectedExceptions = ArithmeticException .class )
1172+ public void testCreatingFromDoubleNan (){
1173+ Money .of (Double .NaN , "XXX" );
1174+ }
1175+
1176+ @ Test (expectedExceptions = ArithmeticException .class )
1177+ public void testCreatingFromDoublePositiveInfinity (){
1178+ Money .of (Double .POSITIVE_INFINITY , "XXX" );
1179+ }
1180+
1181+ @ Test (expectedExceptions = ArithmeticException .class )
1182+ public void testCreatingFromDoubleNegativeInfinity (){
1183+ Money .of (Double .NEGATIVE_INFINITY , "XXX" );
1184+ }
11701185}
Original file line number Diff line number Diff line change @@ -1109,4 +1109,19 @@ public void testDivide_WrongCurrency() {
11091109 m1 .subtract (m2 );
11101110 }
11111111
1112+ @ Test (expectedExceptions = ArithmeticException .class )
1113+ public void testCreatingFromDoubleNan (){
1114+ RoundedMoney .of (Double .NaN , "XXX" );
1115+ }
1116+
1117+ @ Test (expectedExceptions = ArithmeticException .class )
1118+ public void testCreatingFromDoublePositiveInfinity (){
1119+ RoundedMoney .of (Double .POSITIVE_INFINITY , "XXX" );
1120+ }
1121+
1122+ @ Test (expectedExceptions = ArithmeticException .class )
1123+ public void testCreatingFromDoubleNegativeInfinity (){
1124+ RoundedMoney .of (Double .NEGATIVE_INFINITY , "XXX" );
1125+ }
1126+
11121127}
You can’t perform that action at this time.
0 commit comments