Refactor method name
This commit is contained in:
parent
1ba2c2a0dc
commit
7b8b442201
|
@ -41,7 +41,7 @@ public class FormatNumber {
|
||||||
return String.format("%." + places + "f", value);
|
return String.format("%." + places + "f", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String byPaddingOutZeros(int value, int paddingLength) {
|
public static String byPaddingZeros(int value, int paddingLength) {
|
||||||
return String.format("%0" + paddingLength + "d", value);
|
return String.format("%0" + paddingLength + "d", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class FormatNumberUnitTest {
|
||||||
@Test
|
@Test
|
||||||
public void givenIntegerNumber_whenFormatNumber_byPaddingOutZeros_thenGetExpectedResult() {
|
public void givenIntegerNumber_whenFormatNumber_byPaddingOutZeros_thenGetExpectedResult() {
|
||||||
int value = 1;
|
int value = 1;
|
||||||
assertThat(byPaddingOutZeros(value, 3)).isEqualTo("001");
|
assertThat(byPaddingZeros(value, 3)).isEqualTo("001");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue