Exemplo n.º 1
0
        public void KeyBindings_Command()
        {
            var rg = new RadioGroup(new NStack.ustring [] { "Test", "New Test" });

            Assert.True(rg.ProcessKey(new KeyEvent(Key.CursorUp, new KeyModifiers())));
            Assert.True(rg.ProcessKey(new KeyEvent(Key.CursorDown, new KeyModifiers())));
            Assert.True(rg.ProcessKey(new KeyEvent(Key.Home, new KeyModifiers())));
            Assert.True(rg.ProcessKey(new KeyEvent(Key.End, new KeyModifiers())));
            Assert.True(rg.ProcessKey(new KeyEvent(Key.Space, new KeyModifiers())));
            Assert.Equal(1, rg.SelectedItem);
        }
Exemplo n.º 2
0
        public void Initialize_SelectedItem_With_Minus_One()
        {
            var rg = new RadioGroup(new NStack.ustring [] { "Test" }, -1);

            Assert.Equal(-1, rg.SelectedItem);
            Assert.True(rg.ProcessKey(new KeyEvent(Key.Space, new KeyModifiers())));
            Assert.Equal(0, rg.SelectedItem);
        }