Exemple #1
0
        public void _14_WhenStateIsNotWI_SholudReturnOneString()
        {
            // Arrange
            string  state    = "aa";
            decimal amount   = 15.5m;
            int     expected = 1;
            Ex14    ex       = new Ex14(state, amount);

            // Act
            string[] actual = ex.GetResult();
            // Assert
            Assert.AreEqual(expected, actual.Length);
        }
Exemple #2
0
        public PartialViewResult _14([FromBody] Ex14ViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                RedirectToAction(nameof(_14));
            }
            var amount = decimal.Parse(vm.Amount.Replace(".", ","));

            Ex14 ex = new Ex14(vm.State, amount);

            vm.Result = ex.GetResult();

            return(PartialView("_14_partial", vm));
        }