Package org.libreplan.business.workingday

Examples of org.libreplan.business.workingday.IntraDayDate


                haveHours(4, 4, 4));
    }

    @Test
    public void ifTheProvidedIntervalIsAfterTheTaskDoesntAllocateAnything() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        specificResourceAllocation.onIntervalWithinTask(plusDays(start, 5),
                plusDays(start, 6)).allocateHours(12);
        assertTrue(specificResourceAllocation.getAssignments().isEmpty());
    }
View Full Code Here


        assertTrue(specificResourceAllocation.getAssignments().isEmpty());
    }

    @Test
    public void ifTheProvidedIntervalIsBeforeTheTaskDoesntAllocateAnything() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        specificResourceAllocation.onIntervalWithinTask(minusDays(start, 5),
                minusDays(start, 2)).allocateHours(12);
        assertTrue(specificResourceAllocation.getAssignments().isEmpty());
    }
View Full Code Here

        assertTrue(specificResourceAllocation.getAssignments().isEmpty());
    }

    @Test
    public void thePartOfTheIntervalUsedIsTheOneOverlappingWithTheTask() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);

        specificResourceAllocation.fromStartUntil(plusDays(start, 2))
                .allocateHours(16);
        specificResourceAllocation.onIntervalWithinTask(start,
View Full Code Here

                haveHours(3, 3, 3, 3));
    }

    @Test
    public void theEndIsNotChangedIfAZeroAllocationIsDoneInTheLastDay() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        IntraDayDate end = plusDays(start, 4);

        specificResourceAllocation.fromStartUntil(end).allocateHours(32);
        specificResourceAllocation
                .onIntervalWithinTask(plusDays(start, 3), end)
                .allocateHours(0);
View Full Code Here

                equalTo(end));
    }

    @Test
    public void theEndCanGrowUntilReachingTheEndOfTheTask() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        IntraDayDate end = plusDays(start, 4);

        specificResourceAllocation.fromStartUntil(minusDays(end, 1))
                .allocateHours(24);
        assertThat(specificResourceAllocation.getIntraDayEndDate(),
                equalTo(minusDays(end, 1)));
View Full Code Here

                equalTo(end));
    }

    @Test
    public void theStartIsNotChangedIfAZeroAllocationIsDoneInTheFirstDay() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        specificResourceAllocation.fromStartUntil(plusDays(start, 4))
                .allocateHours(32);
        specificResourceAllocation.onIntervalWithinTask(start,
                plusDays(start, 1))
View Full Code Here

                equalTo(start));
    }

    @Test
    public void thereIsAWayForAllocatingOutsideTheBoundsOfTheTask() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        specificResourceAllocation.fromStartUntil(plusDays(start, 4))
                .allocateHours(32);

        specificResourceAllocation.onInterval(plusDays(start, 5),
View Full Code Here

                haveHours(8, 8, 8, 8, 8));
    }

    @Test
    public void canAllocateOutsideTheBoundsUsingAnIntervalMadeOfIntraDayDates() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        specificResourceAllocation.onInterval(start,
                IntraDayDate.create(start.getDate().plusDays(4), hours(4)))
                .allocateHours(36);
        assertThat(specificResourceAllocation.getAssignments(),
                haveHours(8, 8, 8, 8, 4));
    }
View Full Code Here

                haveHours(8, 8, 8, 8, 4));
    }

    @Test
    public void canAllocateOutsideTheBoundsSpecifyingTheHoursForEachDay() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        specificResourceAllocation.onInterval(minusDays(start, 1),
                plusDaysAndEffort(start, 4, hours(4)))
                .allocate(
                        Arrays.asList(hours(8), hours(2), hours(8), hours(8),
View Full Code Here

                haveHours(8, 2, 8, 8, 8, 4));
    }

    @Test
    public void allocatingZeroHoursAtTheEndShrinksTheAllocation() {
        IntraDayDate start = date(2000, 2, 4);
        givenSpecificResourceAllocation(start, 4);
        specificResourceAllocation.fromStartUntil(plusDays(start, 4))
                .allocateHours(32);

        specificResourceAllocation.onInterval(plusDays(start, 3),
View Full Code Here

TOP

Related Classes of org.libreplan.business.workingday.IntraDayDate

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.