Search in sources :

Example 1 with Weapon

use of com.iluwatar.factorykit.Weapon 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 2 with Weapon

use of com.iluwatar.factorykit.Weapon in project java-design-patterns by iluwatar.

the class FactoryKitTest method testSpearWeapon.

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

Example 3 with Weapon

use of com.iluwatar.factorykit.Weapon in project java-design-patterns by iluwatar.

the class FactoryKitTest method testWeapon.

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

Aggregations

Weapon (com.iluwatar.factorykit.Weapon)3 Test (org.junit.jupiter.api.Test)3