use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.
the class RoyaltyObjectMotherTest method queenIsBlockingFlirtCauseDrunkKing.
@Test
public void queenIsBlockingFlirtCauseDrunkKing() {
King drunkUnhappyKing = RoyaltyObjectMother.createDrunkKing();
Queen notFlirtyQueen = RoyaltyObjectMother.createNotFlirtyQueen();
drunkUnhappyKing.flirt(notFlirtyQueen);
assertFalse(drunkUnhappyKing.isHappy());
}
use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.
the class GWeatherTest method testTimePasses.
/**
* Verify if the weather passes in the order of the {@link WeatherType}s
*/
@Test
public void testTimePasses() {
final Race observer = mock(Race.class);
final GWeather weather = new GWeather();
weather.addObserver(observer);
final InOrder inOrder = inOrder(observer);
final WeatherType[] weatherTypes = WeatherType.values();
for (int i = 1; i < 20; i++) {
weather.timePasses();
inOrder.verify(observer).update(weather, weatherTypes[i % weatherTypes.length]);
}
verifyNoMoreInteractions(observer);
}
use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.
the class AlbumListPageTest method testSelectAlbum.
@Test
public void testSelectAlbum() {
AlbumPage albumPage = albumListPage.selectAlbum("21");
albumPage.navigateToPage();
assertTrue(albumPage.isAt());
}
use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.
the class AlbumPageTest method testCancelChanges.
@Test
public void testCancelChanges() {
AlbumListPage albumListPage = albumPage.cancelChanges();
albumListPage.navigateToPage();
assertTrue(albumListPage.isAt());
}
use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.
the class LoginPageTest method testLogin.
@Test
public void testLogin() {
AlbumListPage albumListPage = loginPage.enterUsername("admin").enterPassword("password").login();
albumListPage.navigateToPage();
assertTrue(albumListPage.isAt());
}
Aggregations