static void Main(string[] args) { var mock = new MockMessagePrinter(); ATMCustomer atmCustomer = new ATMCustomer(mock, new RepoTransaction()); atmCustomer.PlaceDeposit(new BankAccount(), 0); Console.WriteLine(mock.Message == "Amount needs to be more than zero. Try again."); Console.ReadLine(); }
public void Should_ShowZeroErrorMessage_OnPlaceDeposit_When_AmountIsZero() { var mock = new MockMessagePrinter(); ATMCustomer atmCustomer = new ATMCustomer(mock, new RepoTransaction()); atmCustomer.PlaceDeposit(new BankAccount(), 0); var expectedMessage = "Amount needs to be more than zero. Try again."; Assert.AreEqual(expectedMessage, mock.Message); }