Skip to content

Commit 12131e7

Browse files
authored
Added tests for cuboid surface area that should fail
I have added tests for cuboid surface area where one of the parameters is invalid. These should fail.
1 parent 4867e4a commit 12131e7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/java/com/thealgorithms/maths/AreaTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ void surfaceAreaCone() {
7575
void testAllIllegalInput() {
7676
assertAll(()
7777
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCube(0)),
78+
()
79+
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCuboid(0, 1, 2)),
80+
()
81+
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCuboid(1, 0, 2)),
82+
()
83+
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaCuboid(1, 2, 0)),
7884
()
7985
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaSphere(0)),
8086
()

0 commit comments

Comments
 (0)