public ActionResult Check()
        {
            int         inputAmount = int.Parse(Request.Form["input-cents"]);
            CoinCombGen change      = new CoinCombGen(inputAmount);

            change.ToChange();
            List <string> OutputCoins = change.GetAll();

            return(View("Result", OutputCoins));
        }
Пример #2
0
        public void Change_GivesMultipleCoins_94()
        {
            CoinCombGen testCoinComb = new CoinCombGen(94);

            testCoinComb.ToChange();
            List <string> OutputCoins   = testCoinComb.GetAll();
            List <string> ExpectedCoins = new List <string>()
            {
                "3 quarter(s)", "1 dime(s)", "1 nickel(s)", "4 penny(s)"
            };

            // Console.WriteLine to see what elements in the List
            foreach (var item in OutputCoins)
            {
                Console.WriteLine(item);
            }

            CollectionAssert.AreEqual(ExpectedCoins, OutputCoins);
        }