Skip to content

Commit

Permalink
LPS-128822 Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed May 20, 2021
1 parent fb4f62a commit f620c75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public void testGetSerializableReturnDoubleWithLocaleBR() {
Serializable serializable = FieldConstants.getSerializable(
LocaleUtil.BRAZIL, LocaleUtil.BRAZIL, FieldConstants.DOUBLE, "3,0");

Assert.assertTrue(serializable instanceof Double);

Assert.assertEquals(Double.valueOf(3.0), (Double)serializable);
}

Expand All @@ -49,8 +47,6 @@ public void testGetSerializableReturnDoubleWithLocaleUS() {
Serializable serializable = FieldConstants.getSerializable(
LocaleUtil.US, LocaleUtil.US, FieldConstants.DOUBLE, "3.0");

Assert.assertTrue(serializable instanceof Double);

Assert.assertEquals(Double.valueOf(3.0), (Double)serializable);
}

Expand All @@ -59,8 +55,6 @@ public void testGetSerializableReturnIntegerWithLocaleBR() {
Serializable serializable = FieldConstants.getSerializable(
LocaleUtil.BRAZIL, LocaleUtil.BRAZIL, FieldConstants.INTEGER, "3");

Assert.assertTrue(serializable instanceof Integer);

Assert.assertEquals(Integer.valueOf(3), (Integer)serializable);
}

Expand All @@ -69,8 +63,6 @@ public void testGetSerializableReturnIntegerWithLocaleUS() {
Serializable serializable = FieldConstants.getSerializable(
LocaleUtil.US, LocaleUtil.US, FieldConstants.INTEGER, "3");

Assert.assertTrue(serializable instanceof Integer);

Assert.assertEquals(Integer.valueOf(3), (Integer)serializable);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,11 @@ public class NumberUtilTest {
LiferayUnitTestRule.INSTANCE;

@Test
public void testGetDecimalSeparatorIndexUsingValueWithComma() {
public void testGetDecimalSeparatorIndex() {
Assert.assertEquals(-1, NumberUtil.getDecimalSeparatorIndex(""));
Assert.assertEquals(-1, NumberUtil.getDecimalSeparatorIndex("2"));
Assert.assertEquals(1, NumberUtil.getDecimalSeparatorIndex("2,0"));
}

@Test
public void testGetDecimalSeparatorIndexUsingValueWithDot() {
Assert.assertEquals(1, NumberUtil.getDecimalSeparatorIndex("2.0"));
}

@Test
public void testGetDecimalSeparatorIndexUsingValueWithNoSeparator() {
Assert.assertEquals(-1, NumberUtil.getDecimalSeparatorIndex("2"));
}

@Test
public void testGetDecimalSeparatorIndexWithEmptyValue() {
Assert.assertEquals(-1, NumberUtil.getDecimalSeparatorIndex(""));
}

}

0 comments on commit f620c75

Please sign in to comment.