-
Notifications
You must be signed in to change notification settings - Fork 711
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from e1121208/pushing-code-coverage-to-the-limit
Pushing code coverage to the limit
- Loading branch information
Showing
6 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package seedu.address.ui; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.testfx.api.FxRobot; | ||
import org.testfx.api.FxToolkit; | ||
import org.testfx.framework.junit5.ApplicationTest; | ||
import org.testfx.util.WaitForAsyncUtils; | ||
|
||
import javafx.scene.input.KeyCode; | ||
import seedu.address.MainApp; | ||
|
||
class MainWindowUiTest extends ApplicationTest { | ||
private MainApp app; | ||
@BeforeEach | ||
public void setUp() throws Exception { | ||
FxToolkit.registerPrimaryStage(); | ||
app = new MainApp(); | ||
FxToolkit.setupApplication(() -> app); | ||
FxToolkit.showStage(); | ||
WaitForAsyncUtils.waitForFxEvents(20); | ||
} | ||
|
||
@Test | ||
void handleHelp_handlesHelpCommandCorrectly() { | ||
FxRobot robot = new FxRobot(); | ||
robot.clickOn("#commandTextField"); | ||
robot.write("help"); | ||
robot.type(KeyCode.ENTER); | ||
assertTrue(robot.lookup("#helpMessage").query().isVisible()); | ||
} | ||
} |