Corrected test as per review comments
This commit is contained in:
parent
625676f7cb
commit
b7f31513f8
|
@ -30,13 +30,13 @@ public class StringToBigIntegerUnitTest {
|
||||||
|
|
||||||
@Test(expected = NumberFormatException.class)
|
@Test(expected = NumberFormatException.class)
|
||||||
public void whenGetStringWithRadix_thenThrowError() {
|
public void whenGetStringWithRadix_thenThrowError() {
|
||||||
final String inputString = "Hello Baeldung";
|
final String inputString = "290f98";
|
||||||
new BigInteger(inputString, 7);
|
new BigInteger(inputString, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetStringUsingByte_thenOk() {
|
public void whenGetStringUsingByte_thenOk() {
|
||||||
final String inputString = "Hello Baeldung";
|
final String inputString = "290f98";
|
||||||
byte[] inputStringBytes = inputString.getBytes();
|
byte[] inputStringBytes = inputString.getBytes();
|
||||||
BigInteger result = new BigInteger(inputStringBytes);
|
BigInteger result = new BigInteger(inputStringBytes);
|
||||||
assertEquals("Hello Baeldung", new String(result.toByteArray()));
|
assertEquals("Hello Baeldung", new String(result.toByteArray()));
|
||||||
|
|
Loading…
Reference in New Issue