public void TestGetChange() { Coin newCoins = new Coin(1.80); Dictionary<string,int> testResults = new Dictionary<string,int>(); testResults.Add("Quarters", 7); testResults.Add("Dimes", 0); testResults.Add("Nickels", 1); testResults.Add("Pennies", 0); Assert.Equal(testResults, newCoins.GetChange()); }
public HomeModule() { Get["/"] = _ => View ["index.cshtml"]; Post["/"] = _ => { Coin newCoin = new Coin(Request.Form["input"]); Dictionary<string,int> returnList = newCoin.GetChange(); return View["index.cshtml", returnList]; }; }
public void TestCoinsGetQuartersYea() { Coin newCoins = new Coin(1.80); Assert.Equal(7, newCoins.GetChangeCount(.25)); }