Rename surfaceAreaTriangle for clarity (#4220)
This commit is contained in:
parent
63739f4933
commit
05ca93eace
@ -100,7 +100,7 @@ public class Area {
|
||||
* @param height height of triangle
|
||||
* @return area of given triangle
|
||||
*/
|
||||
public static double surfaceAreaTriangleRectangle(final double base, final double height) {
|
||||
public static double surfaceAreaTriangle(final double base, final double height) {
|
||||
if (base <= 0) {
|
||||
throw new IllegalArgumentException(POSITIVE_BASE);
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ class AreaTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSurfaceAreaTriangleRectangle() {
|
||||
assertEquals(50.0, Area.surfaceAreaTriangleRectangle(10, 10));
|
||||
void testSurfaceAreaTriangle() {
|
||||
assertEquals(50.0, Area.surfaceAreaTriangle(10, 10));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -81,9 +81,9 @@ class AreaTest {
|
||||
()
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaSquare(0)),
|
||||
()
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaTriangleRectangle(0, 1)),
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaTriangle(0, 1)),
|
||||
()
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaTriangleRectangle(1, 0)),
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaTriangle(1, 0)),
|
||||
()
|
||||
-> assertThrows(IllegalArgumentException.class, () -> Area.surfaceAreaParallelogram(0, 1)),
|
||||
()
|
||||
|
Loading…
Reference in New Issue
Block a user