Summary
This is a refined feature request derived from #2509.
Per @scordio's commented, it might be reasonable to add following signatures.
AbstractStringAssert#asBoolean() returns BooleanAssert
AbstractStringAssert#asByte() returns ByteAssert
AbstractStringAssert#asByte(int radix) returns ByteAssert
AbstractStringAssert#asShort() returns ShortAssert
AbstractStringAssert#asShort(int radix) returns ShortAssert
AbstractStringAssert#asInteger() returns IntegerAssert
AbstractStringAssert#asInteger(int radix) returns IntegerAssert
AbstractStringAssert#asLong() returns LongAssert
AbstractStringAssert#asLong(int radix) returns LongAssert
AbstractStringAssert#asFloat() returns FloatAssert
AbstractStringAssert#asDouble() returns DoubleAssert
NumberFormatException throwable from those parse...(String) methods, except the Boolean#parseBoolean, should be regarded as failing assertions.
Example
assertThat("yes")
// .isNotNull() // implicit
.asBoolean()
.isTrue(); // fails
assertThat("32")
.asInteger()
.isEqualTo(32); // succeeds
assertThat(".0d")
.asDouble()
.isZero();
Summary
This is a refined feature request derived from #2509.
Per @scordio's commented, it might be reasonable to add following signatures.
NumberFormatExceptionthrowable from thoseparse...(String)methods, except theBoolean#parseBoolean, should be regarded as failing assertions.Example