Example #1
0
 public void TestCashRegisterManagerProcessor__Underpayment()
 {
     CashRegisterManager crm = new CashRegisterManager();
      string str = crm.ProcessAmounts(new TransactionAmounts()
      {
          AmountOwed = 5m,
          AmountPaid = 3.3m
      });
      Assert.AreEqual(str, "You still owe 1 Dollar, 2 Quarters, 2 Dimes");
 }
Example #2
0
 public void TestCashRegisterManagerProcessor_Overpayment()
 {
     CashRegisterManager crm = new CashRegisterManager();
     string str = crm.ProcessAmounts(new TransactionAmounts()
     {
         AmountOwed = 3.33m,
         AmountPaid = 5m
     });
     Assert.AreEqual(str, "1 Dollar, 2 Quarters, 1 Dime, 1 Nickel, 2 Pennies");
 }
Example #3
0
 public void TestCashRegisterManagerProcessor__Exact()
 {
     CashRegisterManager crm = new CashRegisterManager();
      string str = crm.ProcessAmounts(new TransactionAmounts()
      {
          AmountOwed = 5m,
          AmountPaid = 5m
      });
      Assert.AreEqual(str, "You have paid the exact amount");
 }
Example #4
0
        private void Execute()
        {
            ICashRegisterInputMgr inputMgr = new CashRegisterInputMgrFactory(MoneyConstants.Infile).GetCashRegisterInputMgr();
            List<TransactionAmounts> list = inputMgr.HandleInput("C:/Dev/CashRegister/input/crt-test-data.csv");

            List<string> strList = new CashRegisterManager().ProcessAmountsFromList(list);

            ICashRegisterOutputMgr outputMgr = new CashRegisterOutputMgrFactory(MoneyConstants.Outfile).GetCashRegisterOutputMgr();
            bool status = outputMgr.HandleOutput("C:/Dev/CashRegister/input/output.csv", strList);
               // Console.ReadLine();
        }
Example #5
0
        public void TestCRM()
        {
            CashRegisterManager crm = new CashRegisterManager();

            crm.ProcessAmounts(new TransactionAmounts()
            {
                AmountOwed = 3.33m,
                AmountPaid = 5m
            });

            //1 Dollar, 2 Quarters, 1 Dime, 1 Nickel, 2 Pennies
        }