Search in sources :

Example 1 with ParameterSignature

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

the class ParameterSignatureTest method wrapperTypesShouldBeAcceptedAsPrimitiveTypes.

@Test
public void wrapperTypesShouldBeAcceptedAsPrimitiveTypes() throws Exception {
    List<ParameterSignature> signatures = ParameterSignature.signatures(getClass().getMethod("intMethod", int.class));
    ParameterSignature intSignature = signatures.get(0);
    assertTrue(intSignature.canAcceptType(Integer.class));
}
Also used : ParameterSignature(org.junit.experimental.theories.ParameterSignature) Test(org.junit.Test)

Example 2 with ParameterSignature

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

the class ParameterSignatureTest method primitiveTypesShouldBeAcceptedAsWrapperTypeAssignables.

@Test
public void primitiveTypesShouldBeAcceptedAsWrapperTypeAssignables() throws Exception {
    List<ParameterSignature> signatures = ParameterSignature.signatures(getClass().getMethod("numberMethod", Number.class));
    ParameterSignature numberSignature = signatures.get(0);
    assertTrue(numberSignature.canAcceptType(int.class));
}
Also used : ParameterSignature(org.junit.experimental.theories.ParameterSignature) Test(org.junit.Test)

Example 3 with ParameterSignature

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

the class Assignments method potentialsForNextUnassigned.

public List<PotentialAssignment> potentialsForNextUnassigned() throws Throwable {
    ParameterSignature unassigned = nextUnassigned();
    List<PotentialAssignment> assignments = getSupplier(unassigned).getValueSources(unassigned);
    if (assignments.isEmpty()) {
        assignments = generateAssignmentsFromTypeAlone(unassigned);
    }
    return assignments;
}
Also used : ParameterSignature(org.junit.experimental.theories.ParameterSignature) PotentialAssignment(org.junit.experimental.theories.PotentialAssignment)

Example 4 with ParameterSignature

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

the class ParameterSignatureTest method primitiveTypesShouldBeAcceptedAsWrapperTypes.

@Test
public void primitiveTypesShouldBeAcceptedAsWrapperTypes() throws Exception {
    List<ParameterSignature> signatures = ParameterSignature.signatures(getClass().getMethod("integerMethod", Integer.class));
    ParameterSignature integerSignature = signatures.get(0);
    assertTrue(integerSignature.canAcceptType(int.class));
}
Also used : ParameterSignature(org.junit.experimental.theories.ParameterSignature) Test(org.junit.Test)

Aggregations

ParameterSignature (org.junit.experimental.theories.ParameterSignature)4 Test (org.junit.Test)3 PotentialAssignment (org.junit.experimental.theories.PotentialAssignment)1