-
-
Save jasongorman/88a183b24e2f9da700b408a410c4ade2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WarehouseTest { | |
@Test | |
public void buyCd(){ | |
CD cd = new CD(10, 9.99); | |
CreditCard card = mock(CreditCard.class); | |
Warehouse warehouse = new Warehouse(); | |
warehouse.buy(cd, 1, card); | |
assertEquals(9, cd.getStock()); | |
verify(card).charge(9.99); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment