Exemple #1
0
        private void MotorSelect_Click(object sender, EventArgs e)
        {
            RadioLabel control = (RadioLabel)sender;

            switch (control.Name)
            {
            case "radioLabel1":
                Context.ActiveMotor = Motor_t.MOTOR_ONE;
                break;

            case "radioLabel2":
                Context.ActiveMotor = Motor_t.MOTOR_TWO;
                break;
            }

            this.Refresh();
        }
Exemple #2
0
        public void WhenRadioLabelInvoked_TheViewModelIsUpdated(string key, string value)
        {
            var values = new Dictionary <string, string>()
            {
                { key, value }
            };

            var component = new RadioLabel();

            component.ViewComponentContext = ViewComponentTestHelper.GetViewComponentContext();

            ViewViewComponentResult result = component.Invoke(values) as ViewViewComponentResult;
            LabelModel resultModel         = (LabelModel)result.ViewData.Model;

            //Assert
            resultModel.AdditionalClass.Should().Contain(value);
        }