public void NullSumCashoutTest() { var atm = new CashoutService(); var money = atm.Cashout(null); Assert.Empty(money.Banknotes); }
public void ImproperNotesCashoutTest() { var atm = new CashoutService(); void act() => atm.Cashout(125); Assert.Throws <NoteUnavailableException>(act); }
public void NegativeSumCashoutTest() { var atm = new CashoutService(); void act() => atm.Cashout(-130); Assert.Throws <InvalidArgumentException>(act); }
public void ProperNotesCashoutTest(int moneyToCashout, int[] notesExpected) { var atm = new CashoutService(); var money = atm.Cashout(moneyToCashout); var notes = money.Banknotes.Select(x => x.Value).ToArray(); var sum = money.Banknotes.Sum(x => x.Value); Assert.Equal(notesExpected, notes); Assert.Equal(moneyToCashout, sum); }