/** * Verifies that the actual value is equal to the given one. * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat(true).isEqualTo(true); * assertThat(Boolean.FALSE).isEqualTo(false); * * // assertions will fail * assertThat(true).isEqualTo(false); * assertThat(Boolean.TRUE).isEqualTo(false);</code></pre> * * @param expected the given value to compare the actual value to. * @return {@code this} assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is not equal to the given one. */ public SELF isEqualTo(boolean expected) { booleans.assertEqual(info, actual, expected); return myself; }
/** * Verifies that the actual value is not equal to the given one. * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat(true).isNotEqualTo(false); * assertThat(Boolean.FALSE).isNotEqualTo(true); * * // assertions will fail * assertThat(true).isNotEqualTo(true); * assertThat(Boolean.FALSE).isNotEqualTo(false);</code></pre> * * @param other the given value to compare the actual value to. * @return {@code this} assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to the given one. */ public SELF isNotEqualTo(boolean other) { booleans.assertNotEqual(info, actual, other); return myself; }
/** * Asserts that two longs are not equal. * @param info contains information about the assertion. * @param actual the actual value. * @param other the value to compare the actual value to. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to the other one. */ public void assertNotEqual(AssertionInfo info, Boolean actual, boolean other) { assertNotNull(info, actual); if (actual != other) return; throw failures.failure(info, shouldNotBeEqual(actual, other)); }
/** * Asserts that two longs are not equal. * @param info contains information about the assertion. * @param actual the actual value. * @param other the value to compare the actual value to. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to the other one. */ public void assertNotEqual(AssertionInfo info, Boolean actual, boolean other) { assertNotNull(info, actual); if (actual != other) return; throw failures.failure(info, shouldNotBeEqual(actual, other)); }
/** * Asserts that two booleans are equal. * @param info contains information about the assertion. * @param actual the actual value. * @param expected the expected value. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is not equal to the expected one. This method will throw a * {@code org.junit.ComparisonFailure} instead if JUnit is in the classpath and the expected and actual values are not * equal. */ public void assertEqual(AssertionInfo info, Boolean actual, boolean expected) { assertNotNull(info, actual); if (actual == expected) return; throw failures.failure(info, shouldBeEqual(actual, expected, info.representation())); }
/** * Verifies that the actual value is equal to the given one. * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat(true).isEqualTo(true); * assertThat(Boolean.FALSE).isEqualTo(false); * * // assertions will fail * assertThat(true).isEqualTo(false); * assertThat(Boolean.TRUE).isEqualTo(false);</code></pre> * * @param expected the given value to compare the actual value to. * @return {@code this} assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is not equal to the given one. */ public SELF isEqualTo(boolean expected) { booleans.assertEqual(info, actual, expected); return myself; }
/** * Verifies that the actual value is not equal to the given one. * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat(true).isNotEqualTo(false); * assertThat(Boolean.FALSE).isNotEqualTo(true); * * // assertions will fail * assertThat(true).isNotEqualTo(true); * assertThat(Boolean.FALSE).isNotEqualTo(false);</code></pre> * * @param other the given value to compare the actual value to. * @return {@code this} assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to the given one. */ public SELF isNotEqualTo(boolean other) { booleans.assertNotEqual(info, actual, other); return myself; }
/** * Asserts that two booleans are equal. * @param info contains information about the assertion. * @param actual the actual value. * @param expected the expected value. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is not equal to the expected one. This method will throw a * {@code org.junit.ComparisonFailure} instead if JUnit is in the classpath and the expected and actual values are not * equal. */ public void assertEqual(AssertionInfo info, Boolean actual, boolean expected) { assertNotNull(info, actual); if (actual == expected) return; throw failures.failure(info, shouldBeEqual(actual, expected, info.representation())); }
/** * Verifies that the actual value is equal to the given one. * * @param expected the given value to compare the actual value to. * @return {@code this} assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is not equal to the given one. */ public S isEqualTo(boolean expected) { booleans.assertEqual(info, actual, expected); return myself; }
/** * Verifies that the actual value is not equal to the given one. * * @param other the given value to compare the actual value to. * @return {@code this} assertion object. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to the given one. */ public S isNotEqualTo(boolean other) { booleans.assertNotEqual(info, actual, other); return myself; }
/** * Asserts that two longs are not equal. * @param info contains information about the assertion. * @param actual the actual value. * @param other the value to compare the actual value to. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is equal to the other one. */ public void assertNotEqual(AssertionInfo info, Boolean actual, boolean other) { assertNotNull(info, actual); if (actual != other) return; throw failures.failure(info, shouldNotBeEqual(actual, other)); }
/** * Asserts that two booleans are equal. * @param info contains information about the assertion. * @param actual the actual value. * @param expected the expected value. * @throws AssertionError if the actual value is {@code null}. * @throws AssertionError if the actual value is not equal to the expected one. This method will throw a * {@code org.junit.ComparisonFailure} instead if JUnit is in the classpath and the expected and actual values are not * equal. */ public void assertEqual(AssertionInfo info, Boolean actual, boolean expected) { assertNotNull(info, actual); if (actual == expected) return; throw failures.failure(info, shouldBeEqual(actual, expected, info.representation())); }