class TestTheRiker:
PRICE: float = 17.01
CALORIES: int = 1701
def test_has_correct_price(self) -> None:
"""The price is correct."""
item: TheRiker = TheRiker()
assert_that(item.price,
is_(TestTheRiker.PRICE))
def test_has_correct_calories(self) -> None:
"""The calories is correct."""
item: TheRiker = TheRiker()
assert_that(item.calories,
is_(TestTheRiker.CALORIES))
public class TheRikerTest {
private static final double PRICE = 17.01;
private static final int CALORIES = 1701;
/**
* The price is correct.
*/
@Test
public void testHasCorrectPrice() {
TheRiker item = new TheRiker();
assertThat(item.getPrice(), is(PRICE));
}
/**
* The calories is correct.
*/
@Test
public void testHasCorrectCalories() {
TheRiker item = new TheRiker();
assertThat(item.getCalories(), is(CALORIES));
}
}
Image Credit: Giphy