更新项目的目录结构

This commit is contained in:
2022-06-06 11:45:45 -04:00
parent c9fd41936a
commit d12ceefac5
3 changed files with 20 additions and 9 deletions
@@ -8,9 +8,14 @@ import org.junit.jupiter.api.TestInstance;
import java.util.Arrays;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* String format to number with NumberFormatException
*
* @author YuCheng
*/
@TestInstance(TestInstance.Lifecycle.PER_METHOD)
public class NumberFormatExceptionTest {
@@ -20,16 +25,22 @@ public class NumberFormatExceptionTest {
@Test
public void ConstructorNumberFormatException() {
Exception exception = assertThrows(NumberFormatException.class, () -> {
// Exception exception = assertThrows(NumberFormatException.class, () -> {
// new Integer("one");
// });
assertThatThrownBy(() -> {
new Integer("one");
});
}).isInstanceOf(NumberFormatException.class).hasMessageStartingWith("For input string");
System.out.println(exception);
// System.out.println(exception);
Integer aIntegerObj = new Integer("one");
Integer aIntegerObj = new Integer("1");
// Integer aIntegerObj = new Integer("one");
Double doubleDecimalObj = new Double("two.2");
}
}