Package org.junit.experimental.theories.internal

Examples of org.junit.experimental.theories.internal.SpecificDataPointsSupplier


        }
    }

    @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"));
    }
View Full Code Here


        assertThat(assignedStrings, hasItems("named field", "named method", "named single value", "named single method value"));
    }
   
    @Test
    public void shouldReturnOnlyTheNamedFieldDataPoints() throws Throwable {
        SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));

        List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedFieldString"));
        List<String> assignedStrings = getStringValuesFromAssignments(assignments);

        assertEquals(1, assignedStrings.size());
        assertThat(assignedStrings, hasItem("named field"));
    }
View Full Code Here

        assertThat(assignedStrings, hasItem("named field"));
    }

    @Test
    public void shouldReturnOnlyTheNamedMethodDataPoints() throws Throwable {
        SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));

        List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedMethodString"));
        List<String> assignedStrings = getStringValuesFromAssignments(assignments);

        assertEquals(1, assignedStrings.size());
        assertThat(assignedStrings, hasItem("named method"));
    }
View Full Code Here

        assertThat(assignedStrings, hasItem("named method"));
    }
   
    @Test
    public void shouldReturnOnlyTheNamedSingleFieldDataPoints() throws Throwable {
        SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));

        List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedSingleFieldString"));
        List<String> assignedStrings = getStringValuesFromAssignments(assignments);

        assertEquals(1, assignedStrings.size());
        assertThat(assignedStrings, hasItem("named single value"));
    }
View Full Code Here

        assertThat(assignedStrings, hasItem("named single value"));
    }

    @Test
    public void shouldReturnOnlyTheNamedSingleMethodDataPoints() throws Throwable {
        SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));

        List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedSingleMethodString"));
        List<String> assignedStrings = getStringValuesFromAssignments(assignments);

        assertEquals(1, assignedStrings.size());
        assertThat(assignedStrings, hasItem("named single method value"));
    }   
View Full Code Here

        assertThat(assignedStrings, hasItem("named single method value"));
    }   
   
    @Test
    public void shouldReturnNothingIfTheNamedDataPointsAreMissing() throws Throwable {
        SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));

        List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingWrongNamedString"));
        List<String> assignedStrings = getStringValuesFromAssignments(assignments);

        assertEquals(0, assignedStrings.size());
    }
View Full Code Here

TOP

Related Classes of org.junit.experimental.theories.internal.SpecificDataPointsSupplier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.