-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add common non infix assertions #26
Conversation
fun Any?.`should be null`() = assertNull(this) | ||
fun Any?.shouldBeNull() = this.`should be null`() | ||
|
||
fun Any?.`should not be null`() = assertNotNull(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about assertNotNull("shouldn't be null", this)
or something similar?
It could be a lot more descriptive than
java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.assertTrue(Assert.java:41)
at org.junit.Assert.assertNotNull(Assert.java:712)
at org.junit.Assert.assertNotNull(Assert.java:722)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find, I've opened an issue #88 and will fix this
Collections:
String/CharSequence:
String?/CharSequence?
Nullable types:
Boolean:
Closes #21