Beispiel #1
0
        public void AddSelectedOptionInGroup()
        {
            var select = new SelectElement
            {
                Value = "lolo"
            };
            var option = new OptionElement
            {
                Value = "lolo"
            };
            var group = new OptionGroup();

            select.AppendChild(group);
            group.AppendChild(option);
            Assert.True(option.Selected);
        }
Beispiel #2
0
        public void SelectValueChangeOnChildOptions()
        {
            var select = new SelectElement();
            var opt1   = new OptionElement
            {
                Value = "a"
            };
            var opt2 = new OptionElement
            {
                Value = "b"
            };
            var group = new OptionGroup();

            group.AppendChild(opt2);
            select.AppendChild(opt1);
            select.AppendChild(group);
            select.Value = "a";
            Assert.True(opt1.Selected);
            Assert.False(opt2.Selected);
            select.Multiple = true;
            select.Value    = "b";
            Assert.True(opt1.Selected);
            Assert.True(opt2.Selected);
        }