mirror of
https://github.com/nasa/trick.git
synced 2025-01-29 23:54:10 +00:00
Implement Status Message Menu Action Tests
This commit is contained in:
parent
2579eaf87b
commit
ac9ff8419e
@ -83,6 +83,7 @@ public class StubbedSimControlApplication extends SimControlApplication {
|
||||
@Override
|
||||
public void clearStatusMsgs() {
|
||||
ActionRecord.push(ActionID.CLEAR_STATUS);
|
||||
super.clearStatusMsgs();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -289,6 +289,41 @@ public class StubbedSimControlTests extends AssertJSwingJUnitTestCase {
|
||||
assertThat(actualFont).isEqualTo(expFont);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSaveStatusMessage() {
|
||||
// ARRANGE
|
||||
ActionID action;
|
||||
JMenuItemFixture saveMsg = getJMenuItemByName(mainFrame, "saveStatusMsgsMenuItem");
|
||||
|
||||
assumeThat(saveMsg).isNotNull();
|
||||
|
||||
// ACT
|
||||
saveMsg.click();
|
||||
action = StubbedSimControlApplication.ActionRecord.peek();
|
||||
|
||||
// ASSERT
|
||||
assertThat(action).isEqualTo(ActionID.SAVE_STATUS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClearStatusMessage() {
|
||||
// ARRANGE
|
||||
ActionID action;
|
||||
JMenuItemFixture clearMsg = getJMenuItemByName(mainFrame, "clearStatusMsgsMenuItem");
|
||||
|
||||
editorFixture.enterText("MOOSE MOOSE MOOSE");
|
||||
|
||||
assumeThat(clearMsg).isNotNull();
|
||||
|
||||
// ACT
|
||||
clearMsg.click();
|
||||
action = StubbedSimControlApplication.ActionRecord.peek();
|
||||
|
||||
// ASSERT
|
||||
assertThat(action).isEqualTo(ActionID.CLEAR_STATUS);
|
||||
assertThat(editorFixture.text()).isEqualTo("");
|
||||
}
|
||||
|
||||
//--------------------
|
||||
// Helper Methods
|
||||
//--------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user