use of com.thecoderscorner.menu.domain.FloatMenuItem in project tcMenu by davetcc.
the class TagValMenuCommandProtocolTest method testWritingFloatItem.
@Test
public void testWritingFloatItem() {
FloatMenuItem floatItem = DomainFixtures.aFloatMenu("FloatMenu", 1);
floatItem = new FloatMenuItemBuilder().withExisting(floatItem).withVisible(false).menuItem();
protocol.toChannel(bb, new MenuFloatBootCommand(22, floatItem, (float) 12.0));
testBufferAgainstExpected(FLOAT_BOOT_ITEM, "PI=22|ID=1|IE=105|NM=FloatMenu|RO=0|VI=0|FD=3|VC=12.0|\u0002");
}
use of com.thecoderscorner.menu.domain.FloatMenuItem in project tcMenu by davetcc.
the class UIRemoteAndFloatMenuItemTest method testFloatMenuItemEditing.
@Test
void testFloatMenuItemEditing(FxRobot robot) throws InterruptedException {
MenuItem floatItem = menuTree.getMenuById(6).get();
VariableNameGenerator vng = new VariableNameGenerator(menuTree, false);
var uiFloatPanel = editorUI.createPanelForMenuItem(floatItem, menuTree, vng, mockedConsumer);
// open the sub menu item editor panel
createMainPanel(uiFloatPanel);
// firstly check that all the fields are populated properly
performAllCommonChecks(floatItem, false);
tryToEnterBadValueIntoField(robot, "decimalPlacesField", "nameField", "100", "Decimal Places - Value must be between 1 and 6");
robot.clickOn("#decimalPlacesField");
robot.eraseText(4);
robot.write("3");
ArgumentCaptor<MenuItem> captor = ArgumentCaptor.forClass(MenuItem.class);
verify(mockedConsumer, atLeastOnce()).accept(any(), captor.capture());
FloatMenuItem item = (FloatMenuItem) captor.getValue();
assertEquals(3, item.getNumDecimalPlaces());
FxAssert.verifyThat("#onlineDocsHyperlink", LabeledMatchers.hasText("Online documentation for FloatMenuItem"));
}
Aggregations