|
|
@ -4,6 +4,10 @@ import org.junit.jupiter.api.AfterEach; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SignUpGUITest { |
|
|
|
private SignUpGUI signUpGUI; |
|
|
|
|
|
|
@ -19,17 +23,21 @@ import org.junit.jupiter.api.BeforeEach; |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void testSignUpButtonActionPerformed() { |
|
|
|
signUpGUI.getUsernameField().setText("testuser"); |
|
|
|
public void testSignUpButtonActionPerformed() { |
|
|
|
// Set up text fields |
|
|
|
signUpGUI.getUsernameField().setText("testUser"); |
|
|
|
signUpGUI.getPasswordField().setText("password"); |
|
|
|
signUpGUI.getConfirmPasswordField().setText("password"); |
|
|
|
signUpGUI.getBirthdayField().setText("2000-01-01"); |
|
|
|
signUpGUI.getBirthdayField().setText("1990-01-01"); |
|
|
|
signUpGUI.getFirstNameField().setText("John"); |
|
|
|
signUpGUI.getSurnameField().setText("Doe"); |
|
|
|
|
|
|
|
signUpGUI.getSignUpButton().doClick(); |
|
|
|
// Perform action |
|
|
|
ActionEvent actionEvent = new ActionEvent(signUpGUI.getSignUpButton(), ActionEvent.ACTION_PERFORMED, ""); |
|
|
|
signUpGUI.actionPerformed(actionEvent); |
|
|
|
|
|
|
|
assertFalse(signUpGUI.isVisible()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |