Skip to content
Snippets Groups Projects
Commit 3d055797 authored by Nicolai Hollup Brand's avatar Nicolai Hollup Brand :penguin:
Browse files

test: goal

parent 9ad7dd30
Branches
Tags
2 merge requests!35test: goal,!7Feat/part three
Pipeline #230946 failed
eilor
::eeee
eeeee
[schni](Eilor )
::Eilor
eilor aaa
[eee](eeee)
...@@ -49,4 +49,14 @@ class GoalFactoryTest { ...@@ -49,4 +49,14 @@ class GoalFactoryTest {
Arguments.of(GoalType.SCORE_GOAL, "", ScoreGoal.class) Arguments.of(GoalType.SCORE_GOAL, "", ScoreGoal.class)
); );
} }
@Test
void getGoal_withValidInventoryGoalValue_returnsInventoryGoalObject() {
GoalType goalType = GoalType.INVENTORY_GOAL;
Object goalValue = "item";
Goal<?> goal = GoalFactory.getGoal(goalType, goalValue);
assertEquals(InventoryGoal.class, goal.getClass());
}
} }
...@@ -63,5 +63,13 @@ class InventoryGoalTest { ...@@ -63,5 +63,13 @@ class InventoryGoalTest {
assertThrows(NullPointerException.class, () -> inventoryGoal.isFulfilled(player)); assertThrows(NullPointerException.class, () -> inventoryGoal.isFulfilled(player));
} }
@Test
public void can_concatenate_two_InventoryGoals() {
InventoryGoal inventoryGoal1 = new InventoryGoal(getMandatoryInventory());
InventoryGoal inventoryGoal2 = new InventoryGoal(getMandatoryInventory());
inventoryGoal1.concatGoals(inventoryGoal2);
assertEquals(4, inventoryGoal1.getGoalValue().size());
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment