Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.SpecificDayAssignment$ParentState


    @Transactional
    public void newAssignmentsImportsTheAssignments() {
        givenWorker();
        LocalDate today = new LocalDate();
        LocalDate tomorrow = today.plus(Days.days(1));
        SpecificDayAssignment specificDayAssignment = new SpecificDayAssignment(
                today, hours(10), worker);
        SpecificDayAssignment another = new SpecificDayAssignment(tomorrow,
                hours(10),
                worker);
        givenWorkerWithAssignments(specificDayAssignment, another);

View Full Code Here


    @Transactional
    public void addingAdditionalAssignmentsKeepOld() {
        givenWorker();
        LocalDate today = new LocalDate();
        LocalDate tomorrow = today.plus(Days.days(1));
        SpecificDayAssignment specificDayAssignment = new SpecificDayAssignment(
                today, hours(10), worker);
        SpecificDayAssignment another = new SpecificDayAssignment(tomorrow,
                hours(10),
                worker);
        givenWorkerWithAssignments(specificDayAssignment, another);

        DayAssignment other = new SpecificDayAssignment(today, hours(3), worker);
        worker.addNewAssignments(Arrays.asList(other));
        assertTrue(worker.getAssignments().size() == assignments.size() + 1);
    }
View Full Code Here

    @Test
    @Transactional
    public void workerWithAssignmentsGivesTheSumOfAssignedHoursForThatDay() {
        givenWorker();
        LocalDate today = new LocalDate();
        SpecificDayAssignment specificDayAssignment = new SpecificDayAssignment(
                today, hours(10), worker);
        SpecificDayAssignment another = new SpecificDayAssignment(today,
                hours(3), worker);
        SpecificDayAssignment atAnotherDay = new SpecificDayAssignment(
                today.plusDays(1), hours(1), worker);
        givenWorkerWithAssignments(specificDayAssignment, another, atAnotherDay);

        assertThat(worker.getAssignedEffort(today), equalTo(hours(13)));
    }
View Full Code Here

    @Test
    @Transactional
    public void afterAddingAnotherDontReturnTheOldResult() {
        givenWorker();
        LocalDate today = new LocalDate();
        SpecificDayAssignment specificDayAssignment = new SpecificDayAssignment(
                today, hours(10), worker);
        givenWorkerWithAssignments(specificDayAssignment);
        SpecificDayAssignment another = new SpecificDayAssignment(today,
                hours(3), worker);
        worker.addNewAssignments(Arrays.asList(another));

        assertThat(worker.getAssignedEffort(today), equalTo(hours(13)));
    }
View Full Code Here

                        if (!allocation.equals(generic
                                .getGenericResourceAllocation())) {
                            return false;
                        }
                    } else if (dayAssignment instanceof SpecificDayAssignment) {
                        SpecificDayAssignment specific = (SpecificDayAssignment) dayAssignment;
                        if (!allocation.equals(specific
                                .getSpecificResourceAllocation())) {
                            return false;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.SpecificDayAssignment$ParentState

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.