Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify tester creation idiom #5

Closed
maciejmikosik opened this issue Dec 4, 2014 · 1 comment
Closed

simplify tester creation idiom #5

maciejmikosik opened this issue Dec 4, 2014 · 1 comment
Assignees
Milestone

Comments

@maciejmikosik
Copy link
Owner

Find a simpler way to create tester implementations.
Currently is looks like this:

  private static Tester<Object> tester(final Object argument) {
    return new Tester<Object>() {
      public Test test(final Object item) {
        String name = " ... ";
        return new TestCase(name) {
          protected void runTest() throws Throwable {
            ...
            assert ...
          }
        };
      }
    };
  }
@maciejmikosik maciejmikosik changed the title simplify tester creation idion simplify tester creation idiom Dec 4, 2014
@maciejmikosik maciejmikosik added this to the 0.2.0 milestone Dec 4, 2014
@maciejmikosik maciejmikosik self-assigned this Dec 4, 2014
@maciejmikosik
Copy link
Owner Author

created BodyTester which helps implementing Tester 222a189

New idiom is

  private static Tester<Object> tester(final Object argument) {
    return new BodyTester<Object>() {
      protected String name(Object item) {
        return " ... ";
      }

      protected void body(Object item) throws Throwable {
         ...
         assert ...
      }
    };
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant