use of org.junit.experimental.theories.PotentialAssignment in project junit4 by junit-team.
the class PotentialAssignmentTest method shouldUseQuotedValueInDescription.
@Test
public void shouldUseQuotedValueInDescription() throws CouldNotGenerateValueException {
String name = "stringDatapoint";
Object value = new Object() {
@Override
public String toString() {
return "string value";
}
};
PotentialAssignment assignment = PotentialAssignment.forValue(name, value);
assertEquals("\"string value\" <from stringDatapoint>", assignment.getDescription());
}
use of org.junit.experimental.theories.PotentialAssignment in project junit4 by junit-team.
the class PotentialAssignmentTest method shouldReturnGivenValue.
@Test
public void shouldReturnGivenValue() throws CouldNotGenerateValueException {
Object value = new Object();
PotentialAssignment assignment = PotentialAssignment.forValue("name", value);
assertEquals(value, assignment.getValue());
}
use of org.junit.experimental.theories.PotentialAssignment in project junit4 by junit-team.
the class TestedOnSupplierTest method descriptionStatesParameterName.
@Test
public void descriptionStatesParameterName() throws Exception {
TestedOnSupplier supplier = new TestedOnSupplier();
List<PotentialAssignment> assignments = supplier.getValueSources(signatureOfFoo());
assertThat(assignments.get(0).getDescription(), is("\"1\" <from ints>"));
}
use of org.junit.experimental.theories.PotentialAssignment in project junit4 by junit-team.
the class AllMembersSupplierTest method dataPointsAnnotationMeansTreatAsArrayOnly.
@Test
public void dataPointsAnnotationMeansTreatAsArrayOnly() throws Throwable {
List<PotentialAssignment> assignments = potentialAssignments(HasDataPointsWithObjectParameter.class.getMethod("theory", Object.class));
assertEquals(2, assignments.size());
for (PotentialAssignment assignment : assignments) {
assertNotEquals(HasDataPointsWithObjectParameter.objectField, assignment.getValue());
}
}
Aggregations