|
| 1 | +import org.junit.Before; |
| 2 | +import org.junit.Test; |
| 3 | +import org.junit.Ignore; |
| 4 | + |
| 5 | +import static org.assertj.core.api.Assertions.*; |
| 6 | + |
| 7 | + |
| 8 | +public class SalaryCalculatorTests { |
| 9 | + |
| 10 | + public SalaryCalculator calculator; |
| 11 | + |
| 12 | + |
| 13 | + @Before |
| 14 | + public void setUp() { |
| 15 | + calculator = new SalaryCalculator(); |
| 16 | + } |
| 17 | + |
| 18 | + @Test |
| 19 | + @Ignore("Remove to run test") |
| 20 | + public void regularSalary() { |
| 21 | + assertThat(calculator.finalSalary(0, 0)).isEqualTo(1000.0); |
| 22 | + } |
| 23 | + |
| 24 | + @Test |
| 25 | + @Ignore("Remove to run test") |
| 26 | + public void skippedBelowThreshold () { |
| 27 | + assertThat(calculator.finalSalary(3, 0)).isEqualTo(1000.0); |
| 28 | + } |
| 29 | + |
| 30 | + @Test |
| 31 | + @Ignore("Remove to run test") |
| 32 | + public void skippedAboveThreshold() { |
| 33 | + assertThat(calculator.finalSalary(5, 0)).isEqualTo(850.0); |
| 34 | + } |
| 35 | + |
| 36 | + @Test |
| 37 | + @Ignore("Remove to run test") |
| 38 | + public void soldBelowThreshold() { |
| 39 | + assertThat(calculator.finalSalary(0, 10)).isEqualTo(1100.0); |
| 40 | + } |
| 41 | + |
| 42 | + @Test |
| 43 | + @Ignore("Remove to run test") |
| 44 | + public void soldAboveThreshold() { |
| 45 | + assertThat(calculator.finalSalary(0, 25)).isEqualTo(1325.0); |
| 46 | + } |
| 47 | + |
| 48 | + @Test |
| 49 | + @Ignore("Remove to run test") |
| 50 | + public void skippedBelowThresholdAndSoldBelowThreshold() { |
| 51 | + assertThat(calculator.finalSalary(2, 5)).isEqualTo(1050.0); |
| 52 | + } |
| 53 | + |
| 54 | + @Test |
| 55 | + @Ignore("Remove to run test") |
| 56 | + public void skippedBelowThresholdAndSoldAboveThreshold() { |
| 57 | + assertThat(calculator.finalSalary(4, 40)).isEqualTo(1520.0); |
| 58 | + } |
| 59 | + |
| 60 | + @Test |
| 61 | + @Ignore("Remove to run test") |
| 62 | + public void skippedAboveThresholdAndSoldBelowThreshold() { |
| 63 | + assertThat(calculator.finalSalary(10, 2)).isEqualTo(870.0); |
| 64 | + } |
| 65 | + |
| 66 | + @Test |
| 67 | + @Ignore("Remove to run test") |
| 68 | + public void skippedAboveThresholdAndSoldAboveThreshold() { |
| 69 | + assertThat(calculator.finalSalary(7, 50)).isEqualTo(1500.0); |
| 70 | + } |
| 71 | + |
| 72 | + @Test |
| 73 | + @Ignore("Remove to run test") |
| 74 | + public void salaryCanReachCloseToMaximum() { |
| 75 | + assertThat(calculator.finalSalary(0, 76)).isEqualTo(1988.0); |
| 76 | + } |
| 77 | + |
| 78 | + @Test |
| 79 | + @Ignore("Remove to run test") |
| 80 | + public void salaryRespectMaximum() { |
| 81 | + assertThat(calculator.finalSalary(0, 77)).isEqualTo(2000.0); |
| 82 | + } |
| 83 | + |
| 84 | +} |
0 commit comments