@Test public void testCalculateTax() throws Exception { Money actualMoney = taxCalculatorService.calculateTax(employee); Money expectedMoney = Money.of(CurrencyUnit.EUR, 10); assertThat(actualMoney).isEqualTo(expectedMoney); }
public Money calculateTax(Employee employee) { runningTimeService.sleep(); double taxAmount = employee.getIncome() * 0.1; Money tax = Money.of(CurrencyUnit.EUR, taxAmount, RoundingMode.HALF_DOWN); return tax; }
TaxCalculatorService { public Money calculateTax(Employee employee) { runningTimeService.sleep(); double taxAmount = employee.getIncome() * 0.1; Money tax = Money.of(CurrencyUnit.EUR, taxAmount, RoundingMode.HALF_DOWN); return tax; } }
TaxCalculatorService { public Money calculateTax(Employee employee) { runningTimeService.sleep(); double taxAmount = employee.getIncome() * 0.1; Money tax = Money.of(CurrencyUnit.EUR, taxAmount, RoundingMode.HALF_DOWN); return tax; }  }
TaxCalculatorService { public Money calculateTax(Employee employee) { runningTimeService.sleep(); double taxAmount = employee.getIncome() * 0.1; Money tax = Money.of(CurrencyUnit.EUR, taxAmount, RoundingMode.HALF_DOWN); return tax; }  Money calculateTax(Employee employee); void setRunningTimeService(RunningTimeService runningTimeService); }
TaxCalculatorService { public Money calculateTax(Employee employee) { runningTimeService.sleep(); double taxAmount = employee.getIncome() * 0.1; Money tax = Money.of(CurrencyUnit.EUR, taxAmount, RoundingMode.HALF_DOWN); return tax; }  Money calculateTax(Employee employee); void setRunningTimeService(RunningTimeService runningTimeService);  }