Examples of IEmployee


Examples of org.springmodules.xt.test.domain.IEmployee

    public void testWithErrorMessage() {
        OfficeIdSpecification spec1 = new OfficeIdSpecification();
        AvailableOfficeSpecification spec2 = new AvailableOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("aaa");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        Notification notification = new NotificationImpl();
       
        assertFalse(this.compositeSpecification.compose(spec1).withMessage(new MessageImpl("wrong.office.id", Message.Type.ERROR, "Wrong Office Id"), false)
View Full Code Here

Examples of org.springmodules.xt.test.domain.IEmployee

    public void testWithWarningMessage() {
        OfficeIdSpecification spec1 = new OfficeIdSpecification();
        AvailableOfficeSpecification spec2 = new AvailableOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("aaa");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        Notification notification = new NotificationImpl();
       
        assertFalse(this.compositeSpecification.compose(spec1).withMessage(new MessageImpl("wrong.office.id", Message.Type.WARNING, "Wrong Office Id"), false)
View Full Code Here

Examples of org.springmodules.xt.test.domain.IEmployee

    public void testWithInfoMessage() {
        OfficeIdSpecification spec1 = new OfficeIdSpecification();
        AvailableOfficeSpecification spec2 = new AvailableOfficeSpecification();
       
        IOffice office1 = new Office();
        IEmployee emp1 = new Employee();
       
        office1.setOfficeId("o1");
        emp1.setMatriculationCode("1");
        office1.addEmployee(emp1);
       
        Notification notification = new NotificationImpl();
       
        assertTrue(this.compositeSpecification.compose(spec1).withMessage(new MessageImpl("good.office.id", Message.Type.INFO, "Good Office Id"), true)
View Full Code Here

Examples of pl.edu.oop.java.company.employee.IEmployee

    }

    @Test
    public void employeeWithAvarageStrategyShouldBeSatisfiedIfSalaryOverAvarage() throws Exception {
        //given
        final IEmployee employee = new Employee(EMPLOYEE_NAME, BigDecimal.valueOf(3001), avarageStrategy);

        //when
        final Answer satisfied = employee.isSatisfied();

        //then
        assertThat(satisfied).isEqualTo(Answer.FINE);
    }
View Full Code Here

Examples of pl.edu.oop.java.company.employee.IEmployee

    }

    @Test
    public void employeeWithAvarageStrategyShouldNotBeSatisfiedIfSalaryIsEqualAvarage() throws Exception {
        //given
        final IEmployee employee = new Employee(EMPLOYEE_NAME, BigDecimal.valueOf(3000), avarageStrategy);

        //when
        final Answer satisfied = employee.isSatisfied();

        //then
        assertThat(satisfied).isEqualTo(Answer.LOW);
    }
View Full Code Here

Examples of pl.edu.oop.java.company.employee.IEmployee

    }

    @Test
    public void employeeWithAvarageStrategyShouldNotBeSatisfiedIfSalaryIsBelowAvarage() throws Exception {
        //given
        final IEmployee employee = new Employee(EMPLOYEE_NAME, BigDecimal.valueOf(2999), avarageStrategy);

        //when
        final Answer satisfied = employee.isSatisfied();

        //then
        assertThat(satisfied).isEqualTo(Answer.LOW);
    }
View Full Code Here

Examples of pl.edu.oop.java.company.employee.IEmployee

    }

    @Test
    public void employeeWithGoodStrategyAlwaysIsSatisfied() throws Exception {
        //given
        final IEmployee employee = new Employee(EMPLOYEE_NAME, BigDecimal.valueOf(2999), goodStrategy);

        //when
        final Answer satisfied = employee.isSatisfied();

        //then
        assertThat(satisfied).isEqualTo(Answer.GOOD);
    }
View Full Code Here

Examples of pl.edu.oop.java.company.employee.IEmployee

    }

    @Test
    public void getSatisfaction_shouldReturnLowWhenGivenSalaryIsBelowAverage() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(BigDecimal.ONE);

        //when
        final Answer satisfaction = instance.getSatisfaction(employee);

        //then
View Full Code Here

Examples of pl.edu.oop.java.company.employee.IEmployee

    }

    @Test
    public void getSatisfaction_shouldReturnLOWWhenGivenSalaryIsEqualAverage() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(CountryAverageSalaryBasedSatisfactionStrategy.AVERAGE_SALARY);

        //when
        final Answer satisfaction = instance.getSatisfaction(employee);

        //then
View Full Code Here

Examples of pl.edu.oop.java.company.employee.IEmployee

    }

    @Test
    public void getSatifaction_shouldReturnFINEWhenGivenSalaryIsAboveAverage() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(CountryAverageSalaryBasedSatisfactionStrategy.AVERAGE_SALARY
                .add(BigDecimal.ONE));

        //when
        final Answer satisfaction = instance.getSatisfaction(employee);
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.