Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
@RunWith(JukitoRunner.class)
public class PatientRendererTest {
public static class Module extends JukitoModule {
@Override
protected void configureTest() {
bindManyInstances(PlusTestCase.class,
new PlusTestCase(1, 2, 3),
new PlusTestCase(-1, 2, 1),
new PlusTestCase(0, 0, 0),
new PlusTestCase(0, 1, 1),
new PlusTestCase(1, 0, 1)
);
}
}
static class PlusTestCase {
int p1;
int p2;
int expected;
public PlusTestCase(int p1, int p2, int expected) {
this.p1 = p1;
this.p2 = p2;
this.expected = expected;
}
}
@Inject
private PlusImpl sut;
@Test
public void plus_returnsExpectedResults(@All PlusTestCase testCase) {
int result = sut.plus(testCase.p1, testCase.p2);
// then
assertThat(result).isEqualTo(testCase.expected);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment