Package pl.edu.oop.java.company.employee

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


    }

    @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

    }

    @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

    }

    @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

    }

    @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

    }

    @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

    }

    @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

    }

    @Test
    public void getSatisfaction_shouldAlwaysReturnAnswerGood() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);

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

        //then
View Full Code Here

TOP

Related Classes of pl.edu.oop.java.company.employee.IEmployee

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.