|
|
@ -1,8 +1,25 @@ |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
|
|
|
|
class LoginGUITest { |
|
|
|
|
|
|
|
private LoginGUI loginGUI; |
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
public void setUp() { |
|
|
|
loginGUI = new LoginGUI(); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testInitialState() { |
|
|
|
assertNotNull(loginGUI.getUsernameField()); |
|
|
|
assertNotNull(loginGUI.getPasswordField()); |
|
|
|
assertNotNull(loginGUI.getLoginButton()); |
|
|
|
assertNotNull(loginGUI.getStayLoggedInCheckbox()); |
|
|
|
assertNotNull(loginGUI.getSignUpButton()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testActionPerformed_LoginButton() { |
|
|
@ -17,5 +34,7 @@ class LoginGUITest { |
|
|
|
// Verify if login was successful |
|
|
|
assertFalse(loginGUI.isVisible()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |