Skip to content

Instantly share code, notes, and snippets.

@jasongorman

jasongorman/WarehouseTest.java Secret

Created Apr 15, 2021
Embed
What would you like to do?
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