public HomeModule() { Get["/"] = _ => { return View["index.cshtml"]; }; Post["/results"] = _ => { int change; int.TryParse(Request.Form["cents"], out change); Change newChange = new Change(); string coins = newChange.CoinChanger(change); return View["results.cshtml", coins]; }; }
public void CoinChanger_ForQuarter() { Change testCoins = new Change(); Assert.Equal("1 quarter 1 dime 1 nickel 1 penny", testCoins.CoinChanger(41)); }
public void CoinChanger_ForPenny() { Change testCoins = new Change(); Assert.Equal("4 pennies", testCoins.CoinChanger(4)); }
public void CoinChanger_ForNickel() { Change testCoins = new Change(); Assert.Equal("1 nickel 1 penny", testCoins.CoinChanger(6)); }
public void CoinChanger_ForDime() { Change testCoins = new Change(); Assert.Equal("1 dime 1 nickel 1 penny", testCoins.CoinChanger(16)); }