Examples of addSatisfaction()


Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Interval intervalA = Interval.range(date(2009,10,8),date(2009,10,25));
        Interval intervalB = Interval.range(date(2009,10,5),date(2009,10,9));
        Interval intervalC = Interval.range(date(2009,11,12),date(2009,11,16));
        Interval intervalE = Interval.range(date(2009,10,26),date(2009,10,30));
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), intervalA);
        //Same Criterion
        assertFalse(worker.canAddSatisfaction(new CriterionWithItsType(
                criterionType, criterion), intervalB));
        //Distinct Criterion
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Criterion criterion = CriterionDAOTest.createValidCriterion();
        Worker worker = Worker.create("firstName", "surName", "2333232");
        ICriterionType<Criterion> criterionType = createTypeThatMatches(false,
                criterion);
        CriterionSatisfaction satisfaction = createValid(criterion, worker);
        worker.addSatisfaction(criterionType, satisfaction);
        assertThat(worker.getAllSatisfactions().size(), equalTo(1));
    }

    private CriterionSatisfaction createValid(Criterion criterion, Worker worker) {
        CriterionSatisfaction satisfaction = CriterionSatisfaction.create();
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        CriterionWithItsType criterionWithItsType = new CriterionWithItsType(
                type, criterion);
        LocalDate today = new LocalDate();
        assertFalse(worker.canAddSatisfaction(criterionWithItsType,
                Interval.from(today)));
        worker.addSatisfaction(criterionWithItsType);
    }

    private Worker worker;
    private List<DayAssignment> assignments;
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Criterion other = CriterionDAOTest.createValidCriterion();
        CriterionTypeBase type = createTypeThatMatches(false, criterion);
        CriterionTypeBase otherType = createTypeThatMatches(false, other);
        Worker worker = Worker.create("firstName", "surName", "2333232");
        assertThat(worker.getSatisfactionsFor(criterion).size(), equalTo(0));
        worker.addSatisfaction(new CriterionWithItsType(type, criterion));
        assertTrue(criterion.isSatisfiedBy(worker));
        assertThat(worker.getSatisfactionsFor(criterion).size(), equalTo(1));
        worker.addSatisfaction(new CriterionWithItsType(otherType, other));
        assertTrue(other.isSatisfiedBy(worker));
        assertThat(worker.getSatisfactionsFor(other).size(), equalTo(1));
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Worker worker = Worker.create("firstName", "surName", "2333232");
        assertThat(worker.getSatisfactionsFor(criterion).size(), equalTo(0));
        worker.addSatisfaction(new CriterionWithItsType(type, criterion));
        assertTrue(criterion.isSatisfiedBy(worker));
        assertThat(worker.getSatisfactionsFor(criterion).size(), equalTo(1));
        worker.addSatisfaction(new CriterionWithItsType(otherType, other));
        assertTrue(other.isSatisfiedBy(worker));
        assertThat(worker.getSatisfactionsFor(other).size(), equalTo(1));
        assertThat(worker.getSatisfactionsFor(criterion).size(), equalTo(1));
    }
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        CriterionWithItsType criterionWithItsType = new CriterionWithItsType(
                criterionType, criterion);
        CriterionWithItsType otherCriterionWithItsType = new CriterionWithItsType(
                createTypeThatMatches(otherCriterion), otherCriterion);
        Worker worker = Worker.create("firstName", "surName", "2333232");
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(3000)));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(4000)));
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        CriterionWithItsType otherCriterionWithItsType = new CriterionWithItsType(
                createTypeThatMatches(otherCriterion), otherCriterion);
        Worker worker = Worker.create("firstName", "surName", "2333232");
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(3000)));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(4000)));
        assertEquals(2, worker.getSatisfactionsFor(criterionType).size());
        assertEquals(1, worker.getCurrentSatisfactionsFor(criterionType).size());
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Worker worker = Worker.create("firstName", "surName", "2333232");
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(3000)));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(4000)));
        assertEquals(2, worker.getSatisfactionsFor(criterionType).size());
        assertEquals(1, worker.getCurrentSatisfactionsFor(criterionType).size());
    }
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

                type, criterion);
        CriterionWithItsType otherCriterionWithItsType = new CriterionWithItsType(
                type, otherCriterion);
        Worker worker = Worker.create("firstName", "surName", "2333232");
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(0));
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(2020)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(1));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(2020)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(1));
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Worker worker = Worker.create("firstName", "surName", "2333232");
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(0));
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(2020)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(1));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(2020)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(1));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(2));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.