public void Inserted_money_goes_to_money_in_transaction() { var snackMachine = new SnackMachineEntity(); snackMachine.InsertMoney(Cent); snackMachine.InsertMoney(Dollar); snackMachine.MoneyInTransaction.Amount.Should().Be(1.01m); }
public void Cannot_insert_more_than_one_coin_or_note_at_a_time() { var snackMachine = new SnackMachineEntity(); var twoCent = Cent + Cent; Action action = () => snackMachine.InsertMoney(twoCent); action.ShouldThrow<InvalidOperationException>(); }
public void Return_money_empties_money_in_transaction() { var snackMachine = new SnackMachineEntity(); snackMachine.InsertMoney(Dollar); snackMachine.ReturnMoney(); snackMachine.MoneyInTransaction.Amount.Should().Be(0m); }
public void Money_in_transaction_goes_to_money_inside_after_purchase() { var snackMachine = new SnackMachineEntity(); snackMachine.InsertMoney(Dollar); snackMachine.InsertMoney(Dollar); snackMachine.BuySnack(); snackMachine.MoneyInTransaction.Should().Be(None); snackMachine.MoneyInside.Amount.Should().Be(2m); }