Repository: TheAlgorithms/Java
Pull request #4220 (2023-06-23 13:58:57)

surfaceAreaTriangle(fn_name_modified)
---changing the function's identifier from **surfaceAreaTriangleRectangle** to **surfaceAreaTriangle**.


THIRU-1074: > Please also update tests

Yeah I have modified and commited.
siriak: Please see build logs, there are some errors Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/Java/Java/src/test/java/com/thealgorithms/maths/AreaTest.java:[39,32] cannot find symbol
  symbol:   method surfaceAreaTriangleRectangle(int,int)
  location: class com.thealgorithms.maths.Area
Error:  /home/runner/work/Java/Java/src/test/java/com/thealgorithms/maths/AreaTest.java:[84,75] cannot find symbol
  symbol:   method surfaceAreaTriangleRectangle(int,int)
  location: class com.thealgorithms.maths.Area
Error:  /home/runner/work/Java/Java/src/test/java/com/thealgorithms/maths/AreaTest.java:[86,75] cannot find symbol
  symbol:   method surfaceAreaTriangleRectangle(int,int)
  location: class com.thealgorithms.maths.Area
THIRU-1074: > Please see build logs, there are some errors Error: COMPILATION ERROR : [INFO] ------------------------------------------------------------- Error: /home/runner/work/Java/Java/src/test/java/com/thealgorithms/maths/AreaTest.java:[39,32] cannot find symbol symbol: method surfaceAreaTriangleRectangle(int,int) location: class com.thealgorithms.maths.Area Error: /home/runner/work/Java/Java/src/test/java/com/thealgorithms/maths/AreaTest.java:[84,75] cannot find symbol symbol: method surfaceAreaTriangleRectangle(int,int) location: class com.thealgorithms.maths.Area Error: /home/runner/work/Java/Java/src/test/java/com/thealgorithms/maths/AreaTest.java:[86,75] cannot find symbol symbol: method surfaceAreaTriangleRectangle(int,int) location: class com.thealgorithms.maths.Area

Thank you ! Siriak for guiding me ...Now all the checks have passed.

Patch:
diff --git a/src/main/java/com/thealgorithms/maths/Area.java b/src/main/java/com/thealgorithms/maths/Area.java
index 262669fe..43d35eea 100644
--- a/src/main/java/com/thealgorithms/maths/Area.java
+++ b/src/main/java/com/thealgorithms/maths/Area.java
@@ -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);
         }


Test patch:
diff --git a/src/test/java/com/thealgorithms/maths/AreaTest.java b/src/test/java/com/thealgorithms/maths/AreaTest.java
index d431c69f..42e6f418 100644
--- a/src/test/java/com/thealgorithms/maths/AreaTest.java
+++ b/src/test/java/com/thealgorithms/maths/AreaTest.java
@@ -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)),
             ()