Package org.libreplan.business.workingday.ResourcesPerDay

Examples of org.libreplan.business.workingday.ResourcesPerDay.ResourcesPerDayDistributor


    }

    @SuppressWarnings("unchecked")
    @Test
    public void canDistributeResourcesPerDay() {
        ResourcesPerDayDistributor distributor = ResourcesPerDay.distributor(
                ResourcesPerDay.amount(new BigDecimal(0.8)), ResourcesPerDay
                        .amount(new BigDecimal(0.2)));
        Object[][] examples = {
                { ResourcesPerDay.amount(10),
                    readsAs(8, 0), readsAs(2, 0) },
                { ResourcesPerDay.amount(1),
                    readsAs(0, 8000), readsAs(0, 2000) },
                { ResourcesPerDay.amount(new BigDecimal(0.5)),
                    readsAs(0, 4000),readsAs(0, 1000) } };
        for (Object[] eachExample : examples) {
            ResourcesPerDay toDistribute = (ResourcesPerDay) eachExample[0];
            Matcher<ResourcesPerDay> firstMatcher = (Matcher<ResourcesPerDay>) eachExample[1];
            Matcher<ResourcesPerDay> secondMatcher = (Matcher<ResourcesPerDay>) eachExample[2];
            ResourcesPerDay[] distribute = distributor.distribute(toDistribute);
            assertThat(distribute[0], firstMatcher);
            assertThat(distribute[1], secondMatcher);
        }
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.workingday.ResourcesPerDay.ResourcesPerDayDistributor

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.