예제 #1
0
 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());
 }
예제 #2
0
        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];
              };
        }
예제 #3
0
 public void TestCoinsGetQuartersYea()
 {
     Coin newCoins = new Coin(1.80);
       Assert.Equal(7, newCoins.GetChangeCount(.25));
 }