-
Notifications
You must be signed in to change notification settings - Fork 39
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
Drop rules from AssertJBigDecimalTemplates
#30
Conversation
Suggested commit message:
|
* <li>{@link BigDecimalAssert#isEqualTo(Object)} (for values 0L, 1L, BigDecimal.ZERO, and | ||
* BigDecimal.ONE) | ||
* <li>{@link BigDecimalAssert#isNotEqualTo(Object)} (for values 0L, 1L, BigDecimal.ZERO, and | ||
* BigDecimal.ONE) |
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.
The implementation appears to indicate that we can rewrite is[Not]EqualTo
for values BigDecimal.ZERO
and BigDecimal.ONE
to isZero()
and isOne()
resp., correct?
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 one, tried to make it more clear, but not really happy with the result. WDYT?
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.
Looking good! 🚀
} | ||
|
||
@AfterTemplate | ||
AbstractBigDecimalAssert<?> after(AbstractBigDecimalAssert<?> bigDecimalAssert) { | ||
return bigDecimalAssert.isEqualTo(0); | ||
return bigDecimalAssert.isZero(); |
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.
If we now rewrite to isZero()
instead if isEqualTo(0)
, then we can keep the bigDecimalAssert.isEqualTo(0L)
rewrite, I would expect, since isZero()
uses comparison.
But... since we don't advocate isZero()
for other types of NumberAssert
, I wonder whether we should perform this rewrite at all. Maybe something to quickly sync on offline.
8edfe77
to
3480d93
Compare
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.
Rebased and added a commit with a slightly different approach, in line with what we discussed offline. PTAL.
Suggested commit message:
Drop or rewrite `AssertJBigDecimalTemplates` rules (#30)
Changes LGTM, nice concise explanation of the discussion 🚀 ! |
We drop these rules because they result in non-compilable code.