Exemplo n.º 1
0
  @Test
  public void testFailBuilder() {
    MockTestDesigner builder =
        new MockTestDesigner(applicationContext) {
          @Override
          public void configure() {
            fail("This test will fail.");
          }
        };

    builder.configure();

    TestCase test = builder.build();
    Assert.assertEquals(test.getActionCount(), 1);
    Assert.assertEquals(test.getActions().get(0).getClass(), FailAction.class);

    FailAction action = (FailAction) test.getActions().get(0);
    Assert.assertEquals(action.getName(), "fail");
    Assert.assertEquals(action.getMessage(), "This test will fail.");
  }