diff --git a/src/main/java/org/assertj/core/internal/Numbers.java b/src/main/java/org/assertj/core/internal/Numbers.java index 4a340fcbe02..574a3b491b1 100644 --- a/src/main/java/org/assertj/core/internal/Numbers.java +++ b/src/main/java/org/assertj/core/internal/Numbers.java @@ -14,8 +14,8 @@ import static java.lang.Math.abs; import static org.assertj.core.error.ShouldBeEqualWithinOffset.shouldBeEqual; -import static org.assertj.core.error.ShouldNotBeEqualWithinOffset.shouldNotBeEqual; import static org.assertj.core.error.ShouldBeEqualWithinPercentage.shouldBeEqualWithinPercentage; +import static org.assertj.core.error.ShouldNotBeEqualWithinOffset.shouldNotBeEqual; import static org.assertj.core.error.ShouldNotBeEqualWithinPercentage.shouldNotBeEqualWithinPercentage; import static org.assertj.core.internal.CommonValidations.checkNumberIsNotNull; import static org.assertj.core.internal.CommonValidations.checkOffsetIsNotNull; @@ -173,11 +173,11 @@ public void assertIsStrictlyBetween(AssertionInfo info, NUMBER actual, NUMBER st * @param offset the given positive offset. */ public void assertIsCloseTo(final AssertionInfo info, final NUMBER actual, final NUMBER expected, - final Offset offset) { + final Offset offset) { assertNotNull(info, actual); checkOffsetIsNotNull(offset); checkNumberIsNotNull(expected); - + if (Objects.areEqual(actual, expected)) return; // handles correctly NaN comparison if (isGreaterThan(absDiff(actual, expected), offset.value)) throw failures.failure(info, shouldBeEqual(actual, expected, offset, absDiff(actual, expected))); @@ -197,7 +197,7 @@ public void assertIsNotCloseTo(final AssertionInfo info, final NUMBER actual, fi checkNumberIsNotNull(expected); NUMBER diff = absDiff(actual, expected); - if (!isGreaterThan(diff, offset.value)) + if (!isGreaterThan(diff, offset.value) || Objects.areEqual(actual, expected)) throw failures.failure(info, shouldNotBeEqual(actual, expected, offset, diff)); } @@ -214,8 +214,11 @@ public void assertIsCloseToPercentage(final AssertionInfo info, final NUMBER act assertNotNull(info, actual); checkPercentageIsNotNull(percentage); checkNumberIsNotNull(other); + + if (Objects.areEqual(actual, other)) return; double acceptableDiff = abs(percentage.value * other.doubleValue() / 100d); - if (absDiff(actual, other).doubleValue() > acceptableDiff) + double actualDiff = absDiff(actual, other).doubleValue(); + if (actualDiff > acceptableDiff || Double.isNaN(actualDiff) || Double.isInfinite(actualDiff)) throw failures.failure(info, shouldBeEqualWithinPercentage(actual, other, percentage, absDiff(actual, other))); } @@ -232,13 +235,16 @@ public void assertIsNotCloseToPercentage(final AssertionInfo info, final NUMBER assertNotNull(info, actual); checkPercentageIsNotNull(percentage); checkNumberIsNotNull(other); + double diff = abs(percentage.value * other.doubleValue() / 100d); - if (absDiff(actual, other).doubleValue() <= diff) + boolean areEqual = Objects.areEqual(actual, other); + if (!areEqual && Double.isInfinite(diff)) return; + if (absDiff(actual, other).doubleValue() <= diff || areEqual) throw failures.failure(info, shouldNotBeEqualWithinPercentage(actual, other, percentage, absDiff(actual, other))); } protected abstract NUMBER absDiff(final NUMBER actual, final NUMBER other); - + protected abstract boolean isGreaterThan(final NUMBER value, final NUMBER other); - + } diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_Test.java index d2f589c7d71..79b68f7b8cf 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_double_with_offset_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_double_with_offset_Test.java index a2af7a31733..f1f907e2727 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_double_with_offset_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_double_with_offset_Test.java @@ -17,8 +17,6 @@ import static org.assertj.core.internal.ErrorMessages.offsetIsNull; import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_with_offset_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_with_offset_Test.java index f14d9a93e20..54c1cccf5b7 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_with_offset_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertEqual_with_offset_Test.java @@ -17,8 +17,6 @@ import static org.assertj.core.internal.ErrorMessages.offsetIsNull; import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThanOrEqualTo_Test.java index 1605f40c21d..d33463add3c 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThanOrEqualTo_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThan_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThan_Test.java index f1b85bfaac3..704747a8fd8 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThan_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertGreaterThan_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsBetween_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsBetween_Test.java index 1761d560fac..d2bf30e199f 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsBetween_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsBetween_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseToPercentage_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseToPercentage_Test.java index c4b7e962f3b..85569cbc723 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseToPercentage_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseToPercentage_Test.java @@ -12,6 +12,9 @@ */ package org.assertj.core.internal.doubles; +import static java.lang.Double.NEGATIVE_INFINITY; +import static java.lang.Double.NaN; +import static java.lang.Double.POSITIVE_INFINITY; import static org.assertj.core.api.Assertions.withinPercentage; import static org.assertj.core.data.Percentage.withPercentage; import static org.assertj.core.error.ShouldBeEqualWithinPercentage.shouldBeEqualWithinPercentage; @@ -97,4 +100,49 @@ public void should_fail_if_actual_is_not_close_enough_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_is_NaN_and_expected_is_not() { + thrown.expectAssertionError(); + doubles.assertIsCloseToPercentage(someInfo(), NaN, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_NaN() { + doubles.assertIsCloseToPercentage(someInfo(), NaN, Double.NaN, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + doubles.assertIsCloseToPercentage(someInfo(), POSITIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_and_expteced_are_POSITIVE_INFINITY() { + doubles.assertIsCloseToPercentage(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + doubles.assertIsCloseToPercentage(someInfo(), NEGATIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_and_expted_are_NEGATIVE_INFINITY() { + doubles.assertIsCloseToPercentage(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsCloseToPercentage(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsCloseToPercentage(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseTo_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseTo_Test.java index e2c22d4e61a..2b156c56e66 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseTo_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsCloseTo_Test.java @@ -12,6 +12,9 @@ */ package org.assertj.core.internal.doubles; +import static java.lang.Double.NEGATIVE_INFINITY; +import static java.lang.Double.NaN; +import static java.lang.Double.POSITIVE_INFINITY; import static org.assertj.core.api.Assertions.within; import static org.assertj.core.error.ShouldBeEqualWithinOffset.shouldBeEqual; import static org.assertj.core.test.TestData.someInfo; @@ -58,7 +61,7 @@ public void should_pass_if_difference_is_equal_to_given_offset() { doubles.assertIsCloseTo(someInfo(), ONE, ZERO, within(ONE)); doubles.assertIsCloseTo(someInfo(), ONE, TWO, within(ONE)); } - + @Test public void should_fail_if_actual_is_not_close_enough_to_expected_value() { AssertionInfo info = someInfo(); @@ -70,4 +73,49 @@ public void should_fail_if_actual_is_not_close_enough_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_is_NaN_and_expected_is_not() { + thrown.expectAssertionError(); + doubles.assertIsCloseTo(someInfo(), NaN, ONE, within(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_NaN() { + doubles.assertIsCloseTo(someInfo(), NaN, NaN, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + doubles.assertIsCloseTo(someInfo(), POSITIVE_INFINITY, ONE, within(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_POSITIVE_INFINITY() { + doubles.assertIsCloseTo(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + doubles.assertIsCloseTo(someInfo(), NEGATIVE_INFINITY, ONE, within(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_NEGATIVE_INFINITY() { + doubles.assertIsCloseTo(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsCloseTo(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsCloseTo(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, within(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseToPercentage_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseToPercentage_Test.java index 2fe851bd528..3377fcdcff1 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseToPercentage_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseToPercentage_Test.java @@ -12,13 +12,9 @@ */ package org.assertj.core.internal.doubles; -import com.tngtech.java.junit.dataprovider.DataProvider; -import com.tngtech.java.junit.dataprovider.DataProviderRunner; -import org.assertj.core.api.AssertionInfo; -import org.assertj.core.internal.DoublesBaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; - +import static java.lang.Double.NEGATIVE_INFINITY; +import static java.lang.Double.NaN; +import static java.lang.Double.POSITIVE_INFINITY; import static java.lang.Math.abs; import static org.assertj.core.api.Assertions.withinPercentage; import static org.assertj.core.data.Percentage.withPercentage; @@ -28,6 +24,14 @@ import static org.assertj.core.util.FailureMessages.actualIsNull; import static org.mockito.Mockito.verify; +import org.assertj.core.api.AssertionInfo; +import org.assertj.core.internal.DoublesBaseTest; +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.tngtech.java.junit.dataprovider.DataProvider; +import com.tngtech.java.junit.dataprovider.DataProviderRunner; + @RunWith(DataProviderRunner.class) public class Doubles_assertIsNotCloseToPercentage_Test extends DoublesBaseTest { @@ -104,4 +108,42 @@ public void should_fail_if_actual_is_too_close_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_and_expected_are_NaN() { + thrown.expectAssertionError(); + doubles.assertIsNotCloseToPercentage(someInfo(), NaN, NaN, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsNotCloseToPercentage(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsNotCloseToPercentage(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + doubles.assertIsNotCloseToPercentage(someInfo(), POSITIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + doubles.assertIsNotCloseToPercentage(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + doubles.assertIsNotCloseToPercentage(someInfo(), NEGATIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + doubles.assertIsNotCloseToPercentage(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseTo_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseTo_Test.java index 2e2b2253b93..57cdc2e8a12 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseTo_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsNotCloseTo_Test.java @@ -12,14 +12,9 @@ */ package org.assertj.core.internal.doubles; -import org.assertj.core.api.AssertionInfo; -import org.assertj.core.internal.DoublesBaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; - -import com.tngtech.java.junit.dataprovider.DataProvider; -import com.tngtech.java.junit.dataprovider.DataProviderRunner; - +import static java.lang.Double.NEGATIVE_INFINITY; +import static java.lang.Double.NaN; +import static java.lang.Double.POSITIVE_INFINITY; import static java.lang.Math.abs; import static org.assertj.core.api.Assertions.byLessThan; import static org.assertj.core.error.ShouldNotBeEqualWithinOffset.shouldNotBeEqual; @@ -28,6 +23,14 @@ import static org.assertj.core.util.FailureMessages.actualIsNull; import static org.mockito.Mockito.verify; +import org.assertj.core.api.AssertionInfo; +import org.assertj.core.internal.DoublesBaseTest; +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.tngtech.java.junit.dataprovider.DataProvider; +import com.tngtech.java.junit.dataprovider.DataProviderRunner; + @RunWith(DataProviderRunner.class) public class Doubles_assertIsNotCloseTo_Test extends DoublesBaseTest { @@ -87,4 +90,42 @@ public void should_fail_if_actual_is_too_close_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_and_expected_are_NaN() { + thrown.expectAssertionError(); + doubles.assertIsNotCloseTo(someInfo(), NaN, NaN, byLessThan(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsNotCloseTo(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, byLessThan(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + doubles.assertIsNotCloseTo(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + doubles.assertIsNotCloseTo(someInfo(), POSITIVE_INFINITY, ONE, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + doubles.assertIsNotCloseTo(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + doubles.assertIsNotCloseTo(someInfo(), NEGATIVE_INFINITY, ONE, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + doubles.assertIsNotCloseTo(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, byLessThan(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsStrictlyBetween_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsStrictlyBetween_Test.java index 080d018631b..a80849b0f4c 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsStrictlyBetween_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertIsStrictlyBetween_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThanOrEqualTo_Test.java index 582de45fa95..96c82d5556e 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThanOrEqualTo_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThan_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThan_Test.java index 37fba600849..ea454203f36 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThan_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertLessThan_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertNotEqual_Test.java b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertNotEqual_Test.java index a9370e75d87..9bd5c31a613 100644 --- a/src/test/java/org/assertj/core/internal/doubles/Doubles_assertNotEqual_Test.java +++ b/src/test/java/org/assertj/core/internal/doubles/Doubles_assertNotEqual_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_Test.java index 4770d66d240..9506fc0b0e8 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_Test.java @@ -16,7 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_float_with_offset_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_float_with_offset_Test.java index a7becab60f2..9bb5d8b8327 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_float_with_offset_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_float_with_offset_Test.java @@ -18,8 +18,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_with_offset_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_with_offset_Test.java index 9971396d89a..349a2ddb404 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_with_offset_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertEqual_with_offset_Test.java @@ -17,8 +17,6 @@ import static org.assertj.core.internal.ErrorMessages.offsetIsNull; import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThanOrEqualTo_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThanOrEqualTo_Test.java index dae9fe5d1f8..745b412c195 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThanOrEqualTo_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThan_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThan_Test.java index 327020e93c8..8c417bdf217 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThan_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertGreaterThan_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsBetween_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsBetween_Test.java index ea17ff0d11d..ebac04b6d7c 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsBetween_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsBetween_Test.java @@ -16,7 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseToPercentage_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseToPercentage_Test.java index 970b6e4d3b0..188c7fd2dc7 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseToPercentage_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseToPercentage_Test.java @@ -12,6 +12,9 @@ */ package org.assertj.core.internal.floats; +import static java.lang.Float.NEGATIVE_INFINITY; +import static java.lang.Float.NaN; +import static java.lang.Float.POSITIVE_INFINITY; import static org.assertj.core.api.Assertions.withinPercentage; import static org.assertj.core.data.Percentage.withPercentage; import static org.assertj.core.error.ShouldBeEqualWithinPercentage.shouldBeEqualWithinPercentage; @@ -96,4 +99,49 @@ public void should_fail_if_actual_is_not_close_enough_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_is_NaN_and_expected_is_not() { + thrown.expectAssertionError(); + floats.assertIsCloseToPercentage(someInfo(), NaN, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_NaN() { + floats.assertIsCloseToPercentage(someInfo(), NaN, NaN, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + floats.assertIsCloseToPercentage(someInfo(), POSITIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_too() { + floats.assertIsCloseToPercentage(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + floats.assertIsCloseToPercentage(someInfo(), NEGATIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_too() { + floats.assertIsCloseToPercentage(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsCloseToPercentage(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsCloseToPercentage(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseTo_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseTo_Test.java index 214bbaf8501..813d9594d8e 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseTo_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsCloseTo_Test.java @@ -12,6 +12,9 @@ */ package org.assertj.core.internal.floats; +import static java.lang.Float.NEGATIVE_INFINITY; +import static java.lang.Float.NaN; +import static java.lang.Float.POSITIVE_INFINITY; import static org.assertj.core.api.Assertions.within; import static org.assertj.core.error.ShouldBeEqualWithinOffset.shouldBeEqual; import static org.assertj.core.test.TestData.someInfo; @@ -70,4 +73,49 @@ public void should_fail_if_actual_is_not_close_enough_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_is_NaN_and_expected_is_not() { + thrown.expectAssertionError(); + floats.assertIsCloseTo(someInfo(), NaN, ONE, within(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_NaN() { + floats.assertIsCloseTo(someInfo(), NaN, NaN, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + floats.assertIsCloseTo(someInfo(), POSITIVE_INFINITY, ONE, within(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_POSITIVE_INFINITY() { + floats.assertIsCloseTo(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + thrown.expectAssertionError(); + floats.assertIsCloseTo(someInfo(), NEGATIVE_INFINITY, ONE, within(ONE)); + } + + @Test + public void should_pass_if_actual_and_expected_are_NEGATIVE_INFINITY() { + floats.assertIsCloseTo(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsCloseTo(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, within(ONE)); + } + + @Test + public void should_fail_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsCloseTo(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, within(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseToPercentage_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseToPercentage_Test.java index 90185360dcb..560ea138674 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseToPercentage_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseToPercentage_Test.java @@ -12,13 +12,9 @@ */ package org.assertj.core.internal.floats; -import com.tngtech.java.junit.dataprovider.DataProvider; -import com.tngtech.java.junit.dataprovider.DataProviderRunner; -import org.assertj.core.api.AssertionInfo; -import org.assertj.core.internal.FloatsBaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; - +import static java.lang.Float.NEGATIVE_INFINITY; +import static java.lang.Float.NaN; +import static java.lang.Float.POSITIVE_INFINITY; import static java.lang.Math.abs; import static org.assertj.core.api.Assertions.withinPercentage; import static org.assertj.core.data.Percentage.withPercentage; @@ -28,6 +24,14 @@ import static org.assertj.core.util.FailureMessages.actualIsNull; import static org.mockito.Mockito.verify; +import org.assertj.core.api.AssertionInfo; +import org.assertj.core.internal.FloatsBaseTest; +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.tngtech.java.junit.dataprovider.DataProvider; +import com.tngtech.java.junit.dataprovider.DataProviderRunner; + @RunWith(DataProviderRunner.class) public class Floats_assertIsNotCloseToPercentage_Test extends FloatsBaseTest { @@ -102,4 +106,42 @@ public void should_fail_if_actual_is_too_close_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_and_expected_are_NaN() { + thrown.expectAssertionError(); + floats.assertIsNotCloseToPercentage(someInfo(), NaN, NaN, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsNotCloseToPercentage(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsNotCloseToPercentage(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + floats.assertIsNotCloseToPercentage(someInfo(), POSITIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + floats.assertIsNotCloseToPercentage(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + floats.assertIsNotCloseToPercentage(someInfo(), NEGATIVE_INFINITY, ONE, withPercentage(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + floats.assertIsNotCloseToPercentage(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, withPercentage(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseTo_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseTo_Test.java index 36b0da843e6..ece68cf0034 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseTo_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotCloseTo_Test.java @@ -12,14 +12,9 @@ */ package org.assertj.core.internal.floats; -import org.assertj.core.api.AssertionInfo; -import org.assertj.core.internal.FloatsBaseTest; -import org.junit.Test; -import org.junit.runner.RunWith; - -import com.tngtech.java.junit.dataprovider.DataProvider; -import com.tngtech.java.junit.dataprovider.DataProviderRunner; - +import static java.lang.Float.NEGATIVE_INFINITY; +import static java.lang.Float.NaN; +import static java.lang.Float.POSITIVE_INFINITY; import static java.lang.Math.abs; import static org.assertj.core.api.Assertions.byLessThan; import static org.assertj.core.error.ShouldNotBeEqualWithinOffset.shouldNotBeEqual; @@ -28,6 +23,14 @@ import static org.assertj.core.util.FailureMessages.actualIsNull; import static org.mockito.Mockito.verify; +import org.assertj.core.api.AssertionInfo; +import org.assertj.core.internal.FloatsBaseTest; +import org.junit.Test; +import org.junit.runner.RunWith; + +import com.tngtech.java.junit.dataprovider.DataProvider; +import com.tngtech.java.junit.dataprovider.DataProviderRunner; + @RunWith(DataProviderRunner.class) public class Floats_assertIsNotCloseTo_Test extends FloatsBaseTest { @@ -87,4 +90,42 @@ public void should_fail_if_actual_is_too_close_to_expected_value() { } failBecauseExpectedAssertionErrorWasNotThrown(); } + + @Test + public void should_fail_if_actual_and_expected_are_NaN() { + thrown.expectAssertionError(); + floats.assertIsNotCloseTo(someInfo(), NaN, NaN, byLessThan(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_POSITIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsNotCloseTo(someInfo(), POSITIVE_INFINITY, POSITIVE_INFINITY, byLessThan(ONE)); + } + + @Test + public void should_fail_if_actual_and_expected_are_NEGATIVE_INFINITY() { + thrown.expectAssertionError(); + floats.assertIsNotCloseTo(someInfo(), NEGATIVE_INFINITY, NEGATIVE_INFINITY, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_not() { + floats.assertIsNotCloseTo(someInfo(), POSITIVE_INFINITY, ONE, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_POSITIVE_INFINITY_and_expected_is_NEGATIVE_INFINITY() { + floats.assertIsNotCloseTo(someInfo(), POSITIVE_INFINITY, NEGATIVE_INFINITY, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_not() { + floats.assertIsNotCloseTo(someInfo(), NEGATIVE_INFINITY, ONE, byLessThan(ONE)); + } + + @Test + public void should_pass_if_actual_is_NEGATIVE_INFINITY_and_expected_is_POSITIVE_INFINITY() { + floats.assertIsNotCloseTo(someInfo(), NEGATIVE_INFINITY, POSITIVE_INFINITY, byLessThan(ONE)); + } } diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotPositive_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotPositive_Test.java index 25b6f1300ad..623ff1834a4 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotPositive_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsNotPositive_Test.java @@ -15,7 +15,6 @@ import static org.assertj.core.test.TestData.someInfo; import org.assertj.core.internal.FloatsBaseTest; - import org.junit.Test; /** diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsOne_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsOne_Test.java index b92002c6994..ca9ba6babdd 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsOne_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsOne_Test.java @@ -12,13 +12,13 @@ */ package org.assertj.core.internal.floats; +import static org.assertj.core.test.TestData.someInfo; + import org.assertj.core.api.AssertionInfo; import org.assertj.core.internal.Floats; import org.assertj.core.internal.FloatsBaseTest; import org.junit.Test; -import static org.assertj.core.test.TestData.someInfo; - /** * Tests for {@link Floats#assertIsOne(AssertionInfo, Float)}}. * diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsStrictlyBetween_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsStrictlyBetween_Test.java index f8fb7f84c7f..fd940249fc8 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertIsStrictlyBetween_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertIsStrictlyBetween_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThanOrEqualTo_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThanOrEqualTo_Test.java index 28fc4c58ffe..25b09d2b96d 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThanOrEqualTo_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThanOrEqualTo_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThan_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThan_Test.java index 98f694adf09..afffcd3ba2a 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThan_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertLessThan_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo; diff --git a/src/test/java/org/assertj/core/internal/floats/Floats_assertNotEqual_Test.java b/src/test/java/org/assertj/core/internal/floats/Floats_assertNotEqual_Test.java index 06b52d6d5c6..99c9b62b9a1 100644 --- a/src/test/java/org/assertj/core/internal/floats/Floats_assertNotEqual_Test.java +++ b/src/test/java/org/assertj/core/internal/floats/Floats_assertNotEqual_Test.java @@ -16,8 +16,6 @@ import static org.assertj.core.test.TestData.someInfo; import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown; import static org.assertj.core.util.FailureMessages.actualIsNull; - - import static org.mockito.Mockito.verify; import org.assertj.core.api.AssertionInfo;