public void testHappyPath() { //write just enough code for the happy path -- make a handmade implementation of the two interfaces, //pass them to the AccountUpdateFacade class and call them from that class. Make up any data you need. IBalanceService balanceService = new StubBalanceService(); ICreditCardService creditCardService = new StubCreditCardService(); AccountUpdater updater = new AccountUpdater(balanceService, creditCardService); updater.UpdateAccount("444444444444", 50.00M, 424242); }
public void simulateFailure() { //now adjust your stub implementation of the interfaces so that it throws one of the exceptions described in FacadeExample.cs. //be sure to change it in such a way that testHappyPath still passes! StubBalanceService balanceService = new StubBalanceService(); ICreditCardService creditCardService = new StubCreditCardService(); // balanceService.SetBroken(true); AccountUpdater updater = new AccountUpdater(balanceService, creditCardService); updater.UpdateAccount("444444444444", 50.00M, 424242); }