public void CalculateTipTest()
        {
            var calculator = new TipCalculator();

            var request = new TipCalculation { MealTotal = 100, TipPercent = .1M };

            var result = calculator.CalculateTip(request);

            Assert.AreEqual(result.TipAmount, 10M);
            Assert.AreEqual(result.TotalAmount, 110M);
        }
        public ActionResult TipCalculator(TipCalculatorRequest request)
        {
            if (ModelState.IsValid)
            {
                var calc = new TipCalculator();

                // convert tip calculator model to tip calculation

                var tipData = new TipCalculation();
                tipData.MealTotal = request.MealTotal.Value;
                tipData.TipPercent = request.TipPercent.Value / 100;

                var result = calc.CalculateTip(tipData);
                return View("TipCalculatorResult", result);
            }
            else
            {
                return View(request);
            }
        }