public void MultipleBuyTicket_CurrentTotal_ZeroAfterBuy() { // Arrange ParkingMachine machine = new ParkingMachine(20); int money = 2 * 24 * 20 + 3 * 20 + 5; // Act machine.InsertMoney(money); machine.BuyTicket(); machine.InsertMoney(money); machine.BuyTicket(); machine.InsertMoney(money); machine.BuyTicket(); // Assert Assert.AreEqual(0, machine.CurrentTotal); }
public void MultipleBuyTicket_Total() { // Arrange ParkingMachine machine = new ParkingMachine(20); int money = 2 * 24 * 20 + 3 * 20 + 5; // Act machine.InsertMoney(money); machine.BuyTicket(); machine.InsertMoney(money); machine.BuyTicket(); machine.InsertMoney(money); machine.BuyTicket(); // Assert Assert.AreEqual(3 * money, machine.Total); }
public void BuyTicket4Day() { // Arrange ParkingMachine machine = new ParkingMachine(20); // Act machine.InsertMoney(20 * 24 * 4); Ticket ticket = machine.BuyTicket(); // Assert Assert.AreEqual(TimeToTicketText(days: 4, hours: 0, minutes: 0), ticket.ToString()); }
public void BuyTicket2Day3Hour15Min() { // Arrange ParkingMachine machine = new ParkingMachine(20); int money = 2 * 24 * 20 + 3 * 20 + 5; // Act machine.InsertMoney(money); Ticket ticket = machine.BuyTicket(); // Assert Assert.AreEqual(TimeToTicketText(days: 2, hours: 3, minutes: 15), ticket.ToString()); }