public IReadOnlyCashTransaction MachineBalance() { var balance = CashTransaction.Start(); foreach (var key in _billInventory.Keys) { balance.Add(key, _billInventory[key]); } return(balance); }
public static IReadOnlyCashTransaction DefaultInventory() { var inventory = CashTransaction.Start(); inventory.Add(UnitedStatesTender.HundredDollar, 10); inventory.Add(UnitedStatesTender.FiftyDollar, 10); inventory.Add(UnitedStatesTender.TwentyDollar, 10); inventory.Add(UnitedStatesTender.TenDollar, 10); inventory.Add(UnitedStatesTender.FiveDollar, 10); inventory.Add(UnitedStatesTender.OneDollar, 10); return(inventory); }
public IReadOnlyCashTransaction InventoryByBills(IReadOnlyList <UnitedStatesTender> bills) { var requestedBillCount = CashTransaction.Start(); foreach (var requestedBill in bills) { if (_billInventory.ContainsKey(requestedBill)) { requestedBillCount.Add(requestedBill, _billInventory[requestedBill]); } else { requestedBillCount.Add(requestedBill, 0); } } return(requestedBillCount); }