@Test(expected = FailFastException.class) public void testStringNonEmptyWithSelfSubstringFailMessage() { String referenceA = "okay"; String regex = referenceA; try { if (checker.isStringMatching(this, referenceA, regex)) { failer.failStringMatching(this, "referenceA", "Extra info goes here"); } } catch (FailFastException failFastException) { assertEquals( "Expected registered exception in failer", failFastException, failer.getFailFastExceptionOrNull()); System.out.println(failFastException.getMessage()); throw failFastException; } }
@Test(expected = FailFastException.class) public void testObjectSameFailMessage() { Object referenceA = new Object(); Object referenceB = referenceA; try { if (checker.isObjectSame(this, referenceA, referenceB)) { failer.failObjectSame(this, "referenceA", "referenceB", "Extra info goes here"); } } catch (FailFastException failFastException) { assertEquals( "Expected registered exception in failer", failFastException, failer.getFailFastExceptionOrNull()); System.out.println(failFastException.getMessage()); throw failFastException; } }
@Test(expected = FailFastException.class) public void testLongOutsideFailMinusZeroVsZero() { long valueA = (0 + 1); long valueMin = 0; long valueMax = 0; try { if (checker.isLongOutside(this, valueA, valueMin, valueMax)) { failer.failLongOutside(this, "valueA", "Extra info goes here"); } } catch (FailFastException failFastException) { assertEquals( "Expected registered exception in failer", failFastException, failer.getFailFastExceptionOrNull()); System.out.println(failFastException.getMessage()); throw failFastException; } }
@Test(expected = FailFastException.class) public void testComparableOutsideFailComparableMax() { long valueA = Long.MAX_VALUE; long valueMin = Long.MIN_VALUE; long valueMax = (Long.MAX_VALUE - 1); try { if (checker.isLongOutside(this, valueA, valueMin, valueMax)) { failer.failLongOutside(this, "valueA", "Extra info goes here"); } } catch (FailFastException failFastException) { assertEquals( "Expected registered exception in failer", failFastException, failer.getFailFastExceptionOrNull()); System.out.println(failFastException.getMessage()); throw failFastException; } }
@Test(expected = FailFastException.class) public void testComparableOutsideFailNoMessage() { long valueA = 121; long valueMin = 122; long valueMax = 123; try { if (checker.isLongOutside(this, valueA, valueMin, valueMax)) { failer.failLongOutside(this, "valueA"); } } catch (FailFastException failFastException) { assertEquals( "Expected registered exception in failer", failFastException, failer.getFailFastExceptionOrNull()); System.out.println(failFastException.getMessage()); throw failFastException; } }
@Test(expected = FailFastException.class) public void testComparableInsideFailComparableMax() { EBar valueA = EBar.VALUE_C; EBar valueMin = EBar.VALUE_C; EBar valueMax = EBar.VALUE_C; try { if (checker.isEnumInside(this, valueA, valueMin, valueMax)) { failer.failEnumInside(this, "valueA", "Extra info goes here"); } } catch (FailFastException failFastException) { assertEquals( "Expected registered exception in failer", failFastException, failer.getFailFastExceptionOrNull()); System.out.println(failFastException.getMessage()); throw failFastException; } }