Add BigDecimalAssertion for floatingPointFormat and IntegerPointFormat#3538
Add BigDecimalAssertion for floatingPointFormat and IntegerPointFormat#3538JunHyungJang wants to merge 7 commits intoassertj:3.xfrom JunHyungJang:3.x
Conversation
feat : BigDecimalAssertion feature + test
joel-costigliola
left a comment
There was a problem hiding this comment.
First round of comments, thanks @JunHyungJang !
| // given | ||
| BigDecimal bigDecimal = new BigDecimal("653.401"); | ||
| // when/then | ||
| assertThat(bigDecimal).isInFloatingPointFormat(); |
There was a problem hiding this comment.
use BDDAssertions.then
|
|
||
| public class BigDecimalAssert_isInFloatingPointFormat_Test { | ||
| @Test | ||
| void should_pass_if_actual_is_in_floating_point_format() { |
There was a problem hiding this comment.
use a parameterized test passing floating point values
| } | ||
|
|
||
| @Test | ||
| void should_fail_if_actual_is_not_in_floating_point_format() { |
There was a problem hiding this comment.
use a parameterized test passing non floating point values
| import static org.assertj.core.util.AssertionsUtil.expectAssertionError; | ||
| public class BigDecimalAssert_isInIntegerFormat_Test { | ||
| @Test | ||
| void should_pass_if_actual_is_in_integer_format() { |
There was a problem hiding this comment.
use a parameterized test passing integer values
There was a problem hiding this comment.
example of a parameterized test: Index_Test
| } | ||
|
|
||
| @Test | ||
| void should_fail_if_actual_is_not_in_integer_format() { |
There was a problem hiding this comment.
use a parameterized test passing non integer values
| @@ -0,0 +1,15 @@ | |||
| package org.assertj.core.error; | |||
|
|
|||
| public class ShouldBeInFloatingPointFormat extends BasicErrorMessageFactory{ | |||
There was a problem hiding this comment.
Add a unit test for this, you can take ShouldBeEven_create_Test as an example to follow
| @@ -0,0 +1,11 @@ | |||
| package org.assertj.core.error; | |||
|
|
|||
| public class ShouldBeInIntegerFormat extends BasicErrorMessageFactory{ public static ErrorMessageFactory shouldBeInIntegerFormat(Object actual) { | |||
There was a problem hiding this comment.
Add a unit test for this, you can take ShouldBeEven_create_Test as an example to follow
There was a problem hiding this comment.
reformat the code with mvn spotless:apply
|
Thank you for the great comment. I change the files following the comment.
|
This is my first attempt to contribute the open sources, so I am not sure what I should do exactly.
I add Assertion and AssertionTest for floatingPointForamt and IntegerPointFormat following
BigDecimal#3532Please let me know, if I should do something more or something to fix
Thank you
Check List:
Following the contributing guidelines will make it easier for us to review and accept your PR.