public void AddPick_NoPick_AddPick() { _menuSelections.AddPick("My Pick"); string selection = _menuSelections.CurrentSelection(); MenuSelections.Type selectionType = _menuSelections.CurrentSelectionType(); Assert.Equal("My Pick", selection); Assert.Equal(MenuSelections.Type.PICK, selectionType); }
public void AddSetting_NoSetting_AddSetting() { _menuSelections.AddSetting("My Setting", new string[] { "state A", "state B" }); string selection = _menuSelections.CurrentSelection(); string setting = _menuSelections.SelectedSettingCurrentState(); MenuSelections.Type selectionType = _menuSelections.CurrentSelectionType(); Assert.Equal("My Setting", selection); Assert.Equal("state A", setting); Assert.Equal(MenuSelections.Type.SETTING, selectionType); }
public void Input(string input, int dTime) { if (input == "S" || input == "DownArrow") { _menuSelections.SelectNext(); } else if (input == "W" || input == "UpArrow") { _menuSelections.SelectPrevious(); } else { MenuSelections.Type type = _menuSelections.CurrentSelectionType(); if (type == MenuSelections.Type.PICK) { InputPick(input, dTime); } if (type == MenuSelections.Type.SETTING) { InputSetting(input, dTime); } } }