mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 06:55:02 +08:00
Add Pronic Number (#2867)
* Add Pronic Number * Update directory * Add unit tests for Pronic Number implementation Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Andrii Siriak <siryaka@gmail.com>
This commit is contained in:
34
src/test/java/com/thealgorithms/maths/PronicNumberTest.java
Normal file
34
src/test/java/com/thealgorithms/maths/PronicNumberTest.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class PronicNumberTest {
|
||||
|
||||
@Test
|
||||
void testForPronicNumber() {
|
||||
|
||||
//given
|
||||
int number = 30;
|
||||
|
||||
//when
|
||||
boolean result = PronicNumber.isPronic(number);
|
||||
|
||||
//then
|
||||
assertTrue(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testForNonPronicNumber() {
|
||||
|
||||
//given
|
||||
int number = 21;
|
||||
|
||||
//when
|
||||
boolean result = PronicNumber.isPronic(number);
|
||||
|
||||
//then
|
||||
assertFalse(result);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user