private static Controller SetupController(string input)
 {
     //Arrange
     var controller = new HomeController();
     //Act
     var inputNumber = new InputNumber {Number = input};
     var result = controller.Index(inputNumber).WithSuccess("", "") as AlertDecoratorResult;
     return controller;
 }
        public void Given80DollarsReturnEightee()
        {
            //Arrange
            var controller = new HomeController();

            //Act
            var inputNumber = new InputNumber {Number = "80"};
            var result = controller.Index(inputNumber) as ViewResult;
            var expected = "EIGHTY DOLLARS";

            //Assert
            if (result != null)
            {
                var actual = result.ViewBag.Output;
            }
        }
        public void Given30DollarsReturnThirty()
        {
            //Arrange
            var controller = new HomeController();

            //Act
            var inputNumber = new InputNumber {Number = "30"};
            var result = controller.Index(inputNumber) as ViewResult;
            var expected = "THIRTEE";

            //Assert
            if (result != null)
            {
                var actual = result.ViewBag.Output;
            }
        }
        public void Given19DollarsReturnNineteen()
        {
            //Arrange
            var controller = new HomeController();

            //Act
            var inputNumber = new InputNumber {Number = "19"};
            var result = controller.Index(inputNumber) as ViewResult;
            var expected = "NINETEEN DOLLARS";

            //Assert
            if (result != null)
            {
                var actual = result.ViewBag.Output;
            }
        }
        private static void ValidateInput(InputNumber inputNumber)
        {
            if (string.IsNullOrWhiteSpace(inputNumber.Number))
            {
                throw new Exception(Language.InputEmptyError);
            }
            if (inputNumber.Number.Split('.').Length > 2)
            {
                throw new Exception(Language.InvalidInput);
            }

            if (inputNumber.Number.StartsWith("."))
            {
                inputNumber.Number = inputNumber.Number.Insert(0, "0");
            }
        }
 private static string AddInputNumberToOutput(InputNumber inputNumber)
 {
     if (!inputNumber.Number.Contains("."))
     {
         return string.Format("{0}{1}", inputNumber.Number, ".00");
     }
     return inputNumber.Number;
 }