SWT301_-_FA_2024_-_PE1_2961.webp
HongThao85

SWT301_-_FA_2024_-_PE1_2961.webp

equivalence partitioning, boundary value analysis, and branch coverage for the
public class OrderCalculatorTest {
Test (expectedIllegalArgumentException.class)
public void testNoltemsInOrder() {
OrderCalculator calculator = new OrderCalculator();calculator.calculateTotal Price (new double()(), "VIP", false, null); // No itens in order
Test
public void testVIFCustomerWithNoDiscount Code () { OrderCalculator calculator new OrderCalculator();
double total calculator.calculateTotalPrice (new double[] [100, 200), "VIP", true, null); // Branch 1: VIP customer assertEquals (240.0, total, 0.01); // 20% discount
// Add more test
37

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:
Test code:
@Test
public void testNegativeX() { assertThrows (IllegalArgumentException.class, () -> { numberProcessor.process Numbers(-1, 5, true);
});
}
+ 100%
Zoom
Close
Chưa có bình luận nào.

Thông tin

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

Image metadata

Filename
SWT301_-_FA_2024_-_PE1_2961.webp
File size
155.3 KB
Dimensions
1920px x 859px

Share this media

Back
Bên trên Bottom