Search in sources :

Example 6 with SpecificDataPointsSupplier

use of org.junit.experimental.theories.internal.SpecificDataPointsSupplier in project junit4 by junit-team.

the class SpecificDataPointsSupplierTest method shouldReturnOnlyTheNamedDataPoints.

@Test
public void shouldReturnOnlyTheNamedDataPoints() throws Throwable {
    SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));
    List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingAllNamedStrings"));
    List<String> assignedStrings = getStringValuesFromAssignments(assignments);
    assertEquals(4, assignedStrings.size());
    assertThat(assignedStrings, hasItems("named field", "named method", "named single value", "named single method value"));
}
Also used : SpecificDataPointsSupplier(org.junit.experimental.theories.internal.SpecificDataPointsSupplier) TestClass(org.junit.runners.model.TestClass) PotentialAssignment(org.junit.experimental.theories.PotentialAssignment) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 PotentialAssignment (org.junit.experimental.theories.PotentialAssignment)6 SpecificDataPointsSupplier (org.junit.experimental.theories.internal.SpecificDataPointsSupplier)6 TestClass (org.junit.runners.model.TestClass)6