@Testvoid testNegative() { assertThrows(IllegalArgumentException.class, () -> { Factorial.fact(1); });}
是测试时根本不会抛出任何异常,idea2021,junit5.7
使用来测试 抛出的 异常 是不是
IllegalArgumentException.class,
Sign in to make a reply
不可掉头--麥子