SWT301_-_FA_2024_-_PE2_3061.webp
T

SWT301_-_FA_2024_-_PE2_3061.webp

31
32
33
34
35
36
37
public class EmployeeBonusCalculatorTest {
@Test (expected IllegalArgumentException.class)
public void testInvalidYearsOfService() {
EmployeeBonusCalculator calculator = new EmployeeBonusCalculator();
calculator.calculateBonus (-1, 50000, true);
}
38
39
40
41
42
43
44
45
46
@Test

}
public void testYearsOfServiceGreaterThanTen () {
EmployeeBonusCalculator calculator = new EmployeeBonusCalculator();
double bonus calculator.calculateBonus (11, 50000, false);
assertEquals (5000.0, bonus, 0.01);
//add more code to complete the test
}
After completing the tests, students should provide a one-line summary for each test case and copy the test code into a Word document for evaluation.
Example:
ID: TC1; Test for
Input parameter:
; Expected result:
}
Zoom
Test code:
@Test
public void testNegativeX() {
assertThrows (IllegalArgumentException.class, () -> { numberProcessor.process Numbers(-1, 5, true);
});

100%
Close
Activate Wir
Go to Settings to
Chưa có bình luận nào.

Thông tin

Category
SWT301
Thêm bởi
Thanh Vân
Ngày thêm
Lượt xem
2,799
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
SWT301_-_FA_2024_-_PE2_3061.webp
File size
191.6 KB
Dimensions
1145px x 916px

Share this media

Back
Bên trên Bottom