/** * Verifies that the actual value is equal to the given one. * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat((byte) 1).isEqualTo((byte) 1); * assertThat((byte) 0).isEqualTo(Byte.valueOf("0")); * * // assertions will fail * assertThat((byte) 1).isEqualTo((byte) 0); * assertThat(Byte.valueOf("1")).isEqualTo((byte) 0);</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(byte expected) { bytes.assertEqual(info, actual, expected); return myself; }
/** * Verifies that the actual value is greater than the given one. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) 2).isGreaterThan((byte) 1); * * // assertion will fail * assertThat((byte) 2).isGreaterThan((byte) 3); * assertThat((byte) 2).isGreaterThan((byte) 2);</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 or less than the given one. */ public SELF isGreaterThan(byte other) { bytes.assertGreaterThan(info, actual, other); return myself; }
/** * Verifies that the actual value is greater than or equal to the given one. * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) 2).isGreaterThanOrEqualTo((byte) 1); * assertThat((byte) 2).isGreaterThanOrEqualTo((byte) 2); * * // assertion will fail * assertThat((byte) 2).isGreaterThanOrEqualTo((byte) 3);</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 less than the given one. */ public SELF isGreaterThanOrEqualTo(byte other) { bytes.assertGreaterThanOrEqualTo(info, actual, other); return myself; }
/** {@inheritDoc} */ @Override public SELF isNotZero() { bytes.assertIsNotZero(info, actual); return myself; }
@Override @CheckReturnValue public SELF usingComparator(Comparator<? super Byte> customComparator, String customComparatorDescription) { this.bytes = new Bytes(new ComparatorBasedComparisonStrategy(customComparator, customComparatorDescription)); return super.usingComparator(customComparator, customComparatorDescription); }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) 1).isPositive(); * * // assertion will fail * assertThat((byte) -1).isPositive();</code></pre> * */ @Override public SELF isPositive() { bytes.assertIsPositive(info, actual); return myself; }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) -1).isNotPositive(); * * // assertion will fail * assertThat((byte) 1).isNotPositive();</code></pre> * */ @Override public SELF isNotPositive() { bytes.assertIsNotPositive(info, actual); return myself; }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) 1).isNotNegative(); * * // assertion will fail * assertThat((byte) -1).isNotNegative();</code></pre> * */ @Override public SELF isNotNegative() { bytes.assertIsNotNegative(info, actual); return myself; }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) -1).isNegative(); * * // assertion will fail * assertThat((byte) 1).isNegative();</code></pre> * */ @Override public SELF isNegative() { bytes.assertIsNegative(info, actual); return myself; }
/** * Verifies that the actual value is in [start, end] range (start included, end included). * * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat((byte) 1).isBetween((byte) -1, (byte) 2); * assertThat((byte) 1).isBetween((byte) 1, (byte) 2); * assertThat((byte) 1).isBetween((byte) 0, (byte) 1); * * // assertion will fail * assertThat((byte) 1).isBetween((byte) 2, (byte) 3);</code></pre> * */ @Override public SELF isBetween(Byte start, Byte end) { bytes.assertIsBetween(info, actual, start, end); return myself; }
/** {@inheritDoc} */ @Override public SELF isNotZero() { bytes.assertIsNotZero(info, actual); return myself; }
@Override @CheckReturnValue public SELF usingComparator(Comparator<? super Byte> customComparator, String customComparatorDescription) { this.bytes = new Bytes(new ComparatorBasedComparisonStrategy(customComparator, customComparatorDescription)); return super.usingComparator(customComparator, customComparatorDescription); }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) 1).isPositive(); * * // assertion will fail * assertThat((byte) -1).isPositive();</code></pre> * */ @Override public SELF isPositive() { bytes.assertIsPositive(info, actual); return myself; }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) -1).isNotPositive(); * * // assertion will fail * assertThat((byte) 1).isNotPositive();</code></pre> * */ @Override public SELF isNotPositive() { bytes.assertIsNotPositive(info, actual); return myself; }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) 1).isNotNegative(); * * // assertion will fail * assertThat((byte) -1).isNotNegative();</code></pre> * */ @Override public SELF isNotNegative() { bytes.assertIsNotNegative(info, actual); return myself; }
/** * {@inheritDoc} * <p> * Example: * <pre><code class='java'> // assertion will pass * assertThat((byte) -1).isNegative(); * * // assertion will fail * assertThat((byte) 1).isNegative();</code></pre> * */ @Override public SELF isNegative() { bytes.assertIsNegative(info, actual); return myself; }
/** * Verifies that the actual value is in [start, end] range (start included, end included). * * <p> * Example: * <pre><code class='java'> // assertions will pass * assertThat((byte) 1).isBetween((byte) -1, (byte) 2); * assertThat((byte) 1).isBetween((byte) 1, (byte) 2); * assertThat((byte) 1).isBetween((byte) 0, (byte) 1); * * // assertion will fail * assertThat((byte) 1).isBetween((byte) 2, (byte) 3);</code></pre> * */ @Override public SELF isBetween(Byte start, Byte end) { bytes.assertIsBetween(info, actual, start, end); return myself; }
/** {@inheritDoc} */ @Override public S isNotZero() { bytes.assertIsNotZero(info, actual); return myself; }
@Override public S usingComparator(Comparator<? super Byte> customComparator) { super.usingComparator(customComparator); this.bytes = new Bytes(new ComparatorBasedComparisonStrategy(customComparator)); return myself; }
/** * {@inheritDoc} * <p> * Example: * * <pre><code class='java'> * // assertion will pass * assertThat((byte) 1).isPositive(); * * // assertion will fail * assertThat((byte) -1).isPositive(); * </code></pre> * * </p> */ @Override public S isPositive() { bytes.assertIsPositive(info, actual); return myself; }