Add tests for power using recursion algorithm (#4335)

This commit is contained in:
Bama Charan Chhandogi
2023-08-28 12:33:27 +05:30
committed by GitHub
parent ebd356e182
commit 80a4435038
3 changed files with 40 additions and 23 deletions

View File

@ -0,0 +1,20 @@
package com.thealgorithms.maths;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
/**
* Test case for Power using Recursion
* @author Bama Charan Chhandogi (https://github.com/BamaCharanChhandogi)
*/
class PowerUsingRecursionTest {
@Test
void testPowerUsingRecursion() {
assertEquals(32.0, PowerUsingRecursion.power(2.0, 5));
assertEquals(97.65625, PowerUsingRecursion.power(2.5, 5));
assertEquals(81, PowerUsingRecursion.power(3, 4));
}
}