Skip to content

Instantly share code, notes, and snippets.

@maio
Created July 18, 2011 20:23
Show Gist options
  • Save maio/1090554 to your computer and use it in GitHub Desktop.
Save maio/1090554 to your computer and use it in GitHub Desktop.
Re: Pětiminutové intro do Mockito knihovny
public void testGetTotalPriceReturnsSumOfAllItemsPrices() {
basket.addItem(new Item(1));
basket.addItem(new Item(2));
assertThat(basket.getTotalPrice(), is(3));
}
public void testClearMakesBasketEmpty() {
basket.addItem(new Item());
basket.clear();
assertTrue(basket.isEmpty());
}
public void testAddItemPutsItemIntoBasket() {
Item item = new Item();
basket.addItem(item);
assertTrue(basket.containsItem(item));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment