File tree 3 files changed +21
-5
lines changed
src/test/java/org/assertj/examples 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 21
21
<properties >
22
22
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
23
23
<neo4j .version>3.0.0</neo4j .version>
24
- <assertj-core .version>3.15.0 </assertj-core .version>
24
+ <assertj-core .version>3.15.1-SNAPSHOT </assertj-core .version>
25
25
</properties >
26
26
27
27
<dependencyManagement >
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ public void number_assertions_with_offset_examples() {
264
264
}
265
265
266
266
@ Test
267
- public void testName () {
267
+ public void isNotCloseTo_examples () {
268
268
final BigInteger eight = new BigInteger ("8" );
269
269
final BigInteger ten = BigInteger .TEN ;
270
270
@@ -351,4 +351,20 @@ public void should_handle_NaN_and_infinity_correctly_fixing_issue_984() {
351
351
fail ("assertThat(Double.NaN).isCloseTo(0.007, withPercentage(0.1)) should have failed" );
352
352
}
353
353
354
+ @ Test
355
+ public void should_behave_according_to_whether_expected_value_is_primitive_or_not () {
356
+ // JDK behavior
357
+ assertThat (Double .NaN != Double .NaN ).isTrue ();
358
+ assertThat (Double .valueOf (Double .NaN ).equals (Double .NaN )).isTrue ();
359
+ assertThat (-0.0 == 0.0 ).isTrue ();
360
+ assertThat (Double .valueOf (0.0 ).equals (-0.0 )).isFalse ();
361
+ // AssertJ behavior
362
+ assertThat (0.0 ).isEqualTo (-0.0 );
363
+ assertThat (-0.0 ).isEqualTo (0.0 );
364
+ assertThat (0.0 ).isNotEqualTo (Double .valueOf (-0.0 ));
365
+ assertThat (Double .NaN ).isNotEqualTo (Double .NaN );
366
+ assertThat (Double .NaN ).isEqualTo (Double .valueOf (Double .NaN ));
367
+ assertThat (-0.0 ).isZero ();
368
+ }
369
+
354
370
}
Original file line number Diff line number Diff line change 17
17
import org .junit .jupiter .api .Test ;
18
18
19
19
/**
20
- *
20
+ *
21
21
* Shows some example of a custom assertion class: {@link org.assertj.examples.custom.TolkienCharacterAssert} that
22
22
* allows us to make assertions specific to {@link org.assertj.examples.data.TolkienCharacter}.
23
23
* <p>
24
- * YOU NEED TO GENERATE ASSERTIONS FOR THID CLASS TO COMPILE, YOU NEED TO EXECUTE THE FOLLOWING COMMAND :
24
+ * YOU NEED TO GENERATE ASSERTIONS FOR THIS CLASS TO COMPILE, YOU NEED TO EXECUTE THE FOLLOWING COMMAND :
25
25
* <pre>
26
26
* mvn clean install
27
27
* </pre>
28
- *
28
+ *
29
29
* @author Joel Costigliola
30
30
*/
31
31
public class BasketBallAssertExamples extends AbstractAssertionsExamples {
You can’t perform that action at this time.
0 commit comments