Skip to content

Commit

Permalink
Merge pull request #29 from UPenn-CIT599/GUI2
Browse files Browse the repository at this point in the history
add PanelCompountTest
  • Loading branch information
Lzimng authored Apr 27, 2020
2 parents 8ae68b2 + f277695 commit 0b9b13a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/PanelComponentsTest.java
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);
}

}

0 comments on commit 0b9b13a

Please sign in to comment.