public ActionResult CoinResult() { CoinCombination inputtedNumber = new CoinCombination(Request.Form["enter-number"]); inputtedNumber.ReturnCoinTypes(); List <double> myCoinCount = inputtedNumber.GetCoinCount(); return(View("Index", myCoinCount)); }
public void IsCoin_AllCoins_True() { CoinCombination newCombination = new CoinCombination(); List <double> testList = new List <double>() { 4, 1, 1, 3 }; CollectionAssert.AreEqual(testList, newCombination.CoinReturn(1.18)); }
public void IsCoin_Penny_True() { CoinCombination newCombination = new CoinCombination(); List <double> testList = new List <double>() { 0, 0, 0, 4 }; CollectionAssert.AreEqual(testList, newCombination.CoinReturn(0.04)); }
public void IsCoin_Dime_True() { CoinCombination newCombination = new CoinCombination(); List <double> testList = new List <double>() { 0, 2, 0, 0 }; CollectionAssert.AreEqual(testList, newCombination.CoinReturn(0.20)); }
public void IsCoin_Quarter_True() { CoinCombination newCombination = new CoinCombination(); List <double> testList = new List <double>() { 4, 0, 0, 0 }; CollectionAssert.AreEqual(testList, newCombination.CoinReturn(1.00)); }
public static void Main() { CoinCombination totalCoinAmount = new CoinCombination(); Console.WriteLine("Enter an amound of cents: "); int centCount = int.Parse(Console.ReadLine()); totalCoinAmount.TotalCoins(centCount); Console.WriteLine("Your change is: "); Console.WriteLine("Quarters: " + totalCoinAmount.GetQuarter()); Console.WriteLine("Dimes: " + totalCoinAmount.GetDimes()); Console.WriteLine("Nickels: " + totalCoinAmount.GetNickels()); Console.WriteLine("Pennies: " + totalCoinAmount.GetPenny()); }
public void InputCheck_InputIsNumber_True() { CoinCombination testCC = new CoinCombination("5"); Assert.AreEqual(true, testCC.InputCheck("5")); }
public void ReturnCoinTypes_InputIsFiftyNineCents_True() { CoinCombination testAmount = new CoinCombination("59"); Assert.AreEqual("2 quarters, 0 dimes, 1 nickels, 4 pennies", testAmount.ReturnCoinTypes()); }
public void ReturnCoinTypes_InputIsTwentyFiveCents_True() { CoinCombination testAmount = new CoinCombination("25"); Assert.AreEqual("1 quarters, 0 dimes, 0 nickels, 0 pennies", testAmount.ReturnCoinTypes()); }
[TestMethod] //this will break soon. will need to update public void ReturnCoinTypes_InputIsEightCents_True() { CoinCombination testAmount = new CoinCombination("8"); Assert.AreEqual("0 quarters, 0 dimes, 1 nickels, 3 pennies", testAmount.ReturnCoinTypes()); }
public void ReturnCoinTypes_InputIsOneCent_True() { CoinCombination testAmount = new CoinCombination("1"); Assert.AreEqual("0 quarters, 0 dimes, 0 nickels, 1 pennies", testAmount.ReturnCoinTypes()); }