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