Skip to content

Anhduc2k2 patch 1 #3131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 15, 2022
37 changes: 37 additions & 0 deletions src/test/java/com/thealgorithms/maths/PerfectSquareTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.thealgorithms.maths;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;


public class PerfectSquareTest{

@Test
public void TestPerfectSquareifiscorrect(){
//Valid Partition
int number = 9;

boolean result = PerfectSquare.isPerfectSquare(number);

assertTrue(result);
}

@Test
public void TestPerfectSquareifisnotcorrect(){
//Invalid Partition 1
int number = 3;

boolean result = PerfectSquare.isPerfectSquare(number);

assertFalse(result);
}
@Test
public void TestPerfectSquareifisNegativeNumber(){
//Invalid Partition 2
int number = -10;

boolean result = PerfectSquare.isPerfectSquare(number);

assertFalse(result);
}
}