|
|
@ -0,0 +1,35 @@ |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.jupiter.api.AfterEach; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
|
|
|
|
|
|
|
|
class SignUpGUITest { |
|
|
|
private SignUpGUI signUpGUI; |
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
void setUp() { |
|
|
|
signUpGUI = new SignUpGUI(); |
|
|
|
signUpGUI.setVisible(true); |
|
|
|
} |
|
|
|
|
|
|
|
@AfterEach |
|
|
|
void tearDown() { |
|
|
|
signUpGUI.dispose(); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void testSignUpButtonActionPerformed() { |
|
|
|
signUpGUI.getUsernameField().setText("testuser"); |
|
|
|
signUpGUI.getPasswordField().setText("password"); |
|
|
|
signUpGUI.getConfirmPasswordField().setText("password"); |
|
|
|
signUpGUI.getBirthdayField().setText("2000-01-01"); |
|
|
|
signUpGUI.getFirstNameField().setText("John"); |
|
|
|
signUpGUI.getSurnameField().setText("Doe"); |
|
|
|
|
|
|
|
signUpGUI.getSignUpButton().doClick(); |
|
|
|
|
|
|
|
assertFalse(signUpGUI.isVisible()); |
|
|
|
} |
|
|
|
|
|
|
|
} |