Package employee

Examples of employee.IEmployee


    }

    @Test
    public void getSatisfaction_shouldReturnLowWhenSalaryIsBelowAverage() {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(BigDecimal.ONE);
        //when
        final Answer satisfaction = instance.getSatisfaction(employee);
        //then
        assertThat(satisfaction).isEqualTo(Answer.BAD);
    }
View Full Code Here


    }

    @Test
    public void getSatisfaction_shouldReturnHighWhenSalaryIsEqualOrOverAverage() {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(BigDecimal.valueOf(10000));
        //when
        final Answer satisfaction = instance.getSatisfaction(employee);
        //then
        assertThat(satisfaction).isEqualTo(Answer.FINE);
    }
View Full Code Here

    }

    @Test
    public void apply_ShouldReturnFalseIfSalaryOfGivenEmployeeIsBelow9000() {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(BigDecimal.valueOf(3000));
        //when
        final Boolean apply = predicate.apply(employee);
        //then
        assertThat(apply).isEqualTo(Boolean.FALSE);
    }
View Full Code Here

    }

    @Test
    public void apply_ShouldReturnTrueIfSalaryOfGivenEmployeeIsOver9000() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(employee.getSalary()).willReturn(BigDecimal.valueOf(10000));
        //when
        final Boolean apply = predicate.apply(employee);
        //then
        assertThat(apply).isEqualTo(Boolean.TRUE);
    }
View Full Code Here

    @Override
    public IEmployee next() {
        final Stack<Iterator<IEmployee>> stack = super.getStack();

        IEmployee next;

        do {
            if (!hasNext()) {
                throw new NoSuchElementException("There is no next element");
            }
View Full Code Here

    }

    @Test
    public void canHire_checkIfUsedHireStrategy() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        //when
        instance.canHire(employee);
        //then
        verify(hireStrategy).getHirePossibility(instance, employee);
    }
View Full Code Here

    }

    @Test
    public void hire_shouldThrowIllegalArgumentException() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(instance.canHire(employee)).willReturn(Boolean.FALSE);
        //when
        when(instance).hire(employee);
        //then
        then(caughtException()).isInstanceOf(IllegalArgumentException.class);
View Full Code Here

    }

    @Test
    public void hire_shouldReturnTrueIfCanHireEmployee() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(instance.canHire(employee)).willReturn(Boolean.TRUE);
        //when
        instance.hire(employee);
        //then
        //TODO:then what?
View Full Code Here

    }

    @Test
    public void fire_shouldReturnFalseIfEmployeeIsNotEmployedByManager() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        //when
        when(instance).fire(employee);
        //then
        then(caughtException()).isInstanceOf(IllegalArgumentException.class);
    }
View Full Code Here

    }

    @Test
    public void fire_shouldReturnTrueIfEmployeeIsEmployedByManager() throws Exception {
        //given
        IEmployee employee = mock(IEmployee.class);
        given(instance.canHire(employee)).willReturn(Boolean.TRUE);
        instance.hire(employee);        //assuming that hiring method is OK
        //when
        when(instance).fire(employee);
        //then
View Full Code Here

TOP

Related Classes of 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.