public void TestAllBlack()
        {
            _Request = new ResistorOhmRequest()
            {
                testScenario = TestScenarioEnum.validateBlackBlackBlack
            };

            var response = _Model.GetOhmValue(_Request).Result;

            Assert.True(response != null && response.Success == true);
            Assert.True(response.Ohm == 0);
        }
Example #2
0
        // GET: Resistor
        public async Task <ActionResult> Index(ResistorViewModel viewModel)
        {
            ResistorOhmRequest  request;
            ResistorOhmResponse respone;

            if (viewModel.btnResistorOhm != null)
            {
                request = new ResistorOhmRequest()
                {
                    bandAColor = viewModel.bandAColor,
                    bandBColor = viewModel.bandBColor,
                    bandCColor = viewModel.bandCColor
                };

                var model = new ResistorModel(_DataAccess);

                respone = await model.GetOhmValue(request);

                if (respone.Success)
                {
                    viewModel.Ohm = respone.Ohm.ToString();
                }
                else
                {
                    ViewBag.Error = respone.Error;
                }
            }
            return(View(viewModel));
        }