Ejemplo n.º 1
0
        public void TestOverrideInvoke()
        {
            //Arrange
            RadioOptions <int> _optionButton = new RadioOptions <int>(RadioOptionsLayout.Horizontal);

            int countSelected = 0;

            int itemId  = _optionButton.AddItem("High", 1, args => { countSelected--; });
            int itemId2 = _optionButton.AddItem("High", 2);

            _optionButton.OnItemSelected += args =>
            {
                countSelected++;
            };

            //Act
            _optionButton.InvokeItemSelected(new RadioOptionItemSelectedEventArgs <int>(itemId, _optionButton));

            //Assert
            Assert.That(countSelected, Is.EqualTo(-1));

            //Act
            _optionButton.InvokeItemSelected(new RadioOptionItemSelectedEventArgs <int>(itemId2, _optionButton));
            _optionButton.InvokeItemSelected(new RadioOptionItemSelectedEventArgs <int>(itemId2, _optionButton));

            //Assert
            Assert.That(countSelected, Is.EqualTo(1));
        }
Ejemplo n.º 2
0
 public RadioOptionItemSelectedEventArgs(int id, RadioOptions <T> button)
 {
     Id     = id;
     Button = button;
 }
Ejemplo n.º 3
0
 public AtawRadioOptionCreator()
 {
     fRadioOptions = new RadioOptions();
     BaseOptions   = fRadioOptions;
 }