private static void StageWithOneTrickHasOneAction() throws Exception { Assert.Print(" StageWithOneTrickHasOneAction"); Trick trick = Mother.forestTrick3; stage.AddToCache(trick); List<GameAction> result = sut.GetAvailableActions(); Assert.AreEqual(result.size(), 1, "Incorrect number of actions returned."); Assert.IsTrue(result.get(0) instanceof DissolveTrick, "Type of gameaction is wrong"); DissolveTrick dissolveTrickAction = (DissolveTrick) result.get(0); Assert.AreEqual(dissolveTrickAction.GetTrick(), trick, "Incorrect trick to dissolve"); pass++; }
private static void EmptyStageAllowsNoActions() throws Exception { Assert.Print(" EmptyStageAllowsNoActions"); List<GameAction> result = sut.GetAvailableActions(); Assert.AreEqual(result.size(), 0, "Incorrect number of actions returned."); pass++; }
private static void WontAddACityToAFolkTrickThatContainsFolkCity() throws Exception { Assert.Print(" WontAddACityToAFolkTrickThatContainsFolkCity"); // One trick Trick trick = Mother.folkTrick3; stage.AddToCache(trick); // The card to add FateCard card = Mother.cityFolk; stage.AddToCamp(card); List<GameAction> result = sut.GetAvailableActions(); Assert.AreEqual(result.size(), 1, "Incorrect number of actions returned."); pass++; }
private static void CanAddACardToAForestTrick() throws Exception { Assert.Print(" CanAddACardToAForestTrick"); Trick trick = Mother.forestTrick3; stage.AddToCache(trick); // The card to add FateCard card = Mother.forestTreasure; stage.AddToCamp(card); List<GameAction> result = sut.GetAvailableActions(); Assert.AreEqual(result.size(), 2, "Incorrect number of actions returned."); AddToTrick resultAction = null; for (GameAction action : result) { if (action instanceof AddToTrick) { Assert.AreEqual(null, resultAction, "2 candidates AddToTricks have been found."); resultAction = (AddToTrick) action; } } Assert.AreNotEqual((AddToTrick) null, resultAction, "No AddToTrick found."); Assert.AreEqual(trick, resultAction.GetTrick(), "Adding to the wrong trick."); Assert.AreEqual(card, resultAction.GetCard(), "Adding the wrong card to the trick."); pass++; }