-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from UPenn-CIT599/GUI2
add PanelCompountTest
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class PanelComponentsTest { | ||
|
||
@Test | ||
void testCheckInput() { | ||
double upper = 100.0; | ||
double lower = 10.0; | ||
double num1 = 50.0; | ||
double num2 = 110.0; | ||
assertEquals(PanelComponents.checkInput(num1, upper, lower), true); | ||
assertEquals(PanelComponents.checkInput(num2, upper, lower), false); | ||
} | ||
|
||
@Test | ||
void testIsNumeric() { | ||
String str1 = "100"; | ||
String str2 = "100.1"; | ||
String str3 = "nonNumber"; | ||
String str4 = " "; | ||
|
||
assertEquals(PanelComponents.isNumeric(str1), true); | ||
assertEquals(PanelComponents.isNumeric(str2), true); | ||
assertEquals(PanelComponents.isNumeric(str3), false); | ||
assertEquals(PanelComponents.isNumeric(str4), false); | ||
} | ||
|
||
} |