Search in sources :

Example 11 with Test

use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.

the class CommanderTest method commanderReady.

@Test
public void commanderReady() throws Exception {
    final Commander commander = new Commander(new CommanderUnit("CommanderUnitTest"));
    commander.commanderReady();
}
Also used : CommanderUnit(units.CommanderUnit) Test(org.junit.jupiter.api.Test)

Example 12 with Test

use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.

the class SoldierTest method soldierReady.

@Test
public void soldierReady() throws Exception {
    final Soldier soldier = new Soldier(new SoldierUnit("SoldierUnitTest"));
    soldier.soldierReady();
}
Also used : SoldierUnit(units.SoldierUnit) Test(org.junit.jupiter.api.Test)

Example 13 with Test

use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.

the class FactoryKitTest method testAxeWeapon.

/**
 * Testing {@link WeaponFactory} to produce a AXE asserting that the Weapon is an instance of {@link Axe}
 */
@Test
public void testAxeWeapon() {
    Weapon weapon = factory.create(WeaponType.AXE);
    verifyWeapon(weapon, Axe.class);
}
Also used : Weapon(com.iluwatar.factorykit.Weapon) Test(org.junit.jupiter.api.Test)

Example 14 with Test

use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.

the class ContentStoreTest method testOnAction.

@Test
public void testOnAction() throws Exception {
    final ContentStore contentStore = new ContentStore();
    final View view = mock(View.class);
    contentStore.registerView(view);
    verifyZeroInteractions(view);
    // Content should not react on menu action ...
    contentStore.onAction(new MenuAction(MenuItem.PRODUCTS));
    verifyZeroInteractions(view);
    // ... but it should react on a content action
    contentStore.onAction(new ContentAction(Content.COMPANY));
    verify(view, times(1)).storeChanged(eq(contentStore));
    verifyNoMoreInteractions(view);
    assertEquals(Content.COMPANY, contentStore.getContent());
}
Also used : MenuAction(com.iluwatar.flux.action.MenuAction) ContentAction(com.iluwatar.flux.action.ContentAction) View(com.iluwatar.flux.view.View) Test(org.junit.jupiter.api.Test)

Example 15 with Test

use of org.junit.jupiter.api.Test in project java-design-patterns by iluwatar.

the class ContentViewTest method testStoreChanged.

@Test
public void testStoreChanged() throws Exception {
    final ContentStore store = mock(ContentStore.class);
    when(store.getContent()).thenReturn(Content.PRODUCTS);
    final ContentView view = new ContentView();
    view.storeChanged(store);
    verify(store, times(1)).getContent();
    verifyNoMoreInteractions(store);
}
Also used : ContentStore(com.iluwatar.flux.store.ContentStore) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)265 BigInteger (java.math.BigInteger)50 JsonObject (io.vertx.core.json.JsonObject)20 NemAnnounceResult (com.github.rosklyar.client.transaction.domain.NemAnnounceResult)15 PublicAccount (io.nem.sdk.model.account.PublicAccount)14 AnalysisResult (io.github.vocabhunter.analysis.model.AnalysisResult)12 Address (io.nem.sdk.model.account.Address)10 NamespaceId (io.nem.sdk.model.namespace.NamespaceId)10 ExecutorService (java.util.concurrent.ExecutorService)9 UnconfirmedTransactions (com.github.rosklyar.client.account.domain.transaction.UnconfirmedTransactions)7 MosaicId (com.github.rosklyar.client.transaction.domain.mosaic.MosaicId)7 Transactions (com.github.rosklyar.client.account.domain.transaction.Transactions)6 PsiClass (com.intellij.psi.PsiClass)6 Mosaic (io.nem.sdk.model.mosaic.Mosaic)6 MosaicId (io.nem.sdk.model.mosaic.MosaicId)6 Disabled (org.junit.jupiter.api.Disabled)6 DisplayName (org.junit.jupiter.api.DisplayName)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 InOrder (org.mockito.InOrder)6 SpellDao (com.iluwatar.servicelayer.spell.SpellDao)5