@Test public void testNotEndsWith() { // GIVEN String expected = "value"; String actual = "value test"; // WHEN / THEN GAssert.assertNotEndsWith(expected, actual); }
@Test public void testNotEndsWith_actualToShort_fail() { // GIVEN String expected = "test"; String actual = "lue"; // WHEN GAssert.assertNotEndsWith(expected, actual); // THEN }
@Test public void testNotEndsWith_fail_toShort() { // GIVEN String expected = ""; String actual = "test value"; try { // WHEN GAssert.assertNotEndsWith(expected, actual); fail(); } catch (AssertionError e) { // THEN assertEquals( "Expected: not a string ending with \"\"\n" // + " but: was \"test value\" expected:<[]> but was:<[test value]>", e.getMessage()); } }
@Test public void testNotEndsWith_fail() { // GIVEN String expected = "test"; String actual = "value test"; try { // WHEN GAssert.assertNotEndsWith(expected, actual); fail(); } catch (ComparisonFailure e) { // THEN assertEquals( "Expected: not a string ending with \"test\"\n" // + " but: was \"value test\" expected:<[]test> but was:<[value ]test>", e.getMessage()); } }