Exemplo n.º 1
0
  @Test
  public void testNotEndsWith() {
    // GIVEN
    String expected = "value";
    String actual = "value test";

    // WHEN / THEN
    GAssert.assertNotEndsWith(expected, actual);
  }
Exemplo n.º 2
0
  @Test
  public void testNotEndsWith_actualToShort_fail() {
    // GIVEN
    String expected = "test";
    String actual = "lue";

    // WHEN
    GAssert.assertNotEndsWith(expected, actual);

    // THEN

  }
Exemplo n.º 3
0
  @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());
    }
  }
Exemplo n.º 4
0
  @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());
    }
  }