public void TestDevCardsContainsReturnsFalseWhenCardIsNotInHand() { var target = new Hand(); List<DevelopmentCard> knight = new List<DevelopmentCard>(); knight.Add(new Knight()); target.addDevCard(knight); Assert.IsFalse(target.devCardsContains("monopoly")); List<DevelopmentCard> monopoly = new List<DevelopmentCard>(); monopoly.Add(new MonopolyCard()); target.addDevCard(monopoly); Assert.IsFalse(target.devCardsContains("victoryPoint")); List<DevelopmentCard> victoryPoint = new List<DevelopmentCard>(); victoryPoint.Add(new VictoryPointCard()); target.addDevCard(victoryPoint); Assert.IsFalse(target.devCardsContains("roadBuilder")); List<DevelopmentCard> roadBuilder = new List<DevelopmentCard>(); roadBuilder.Add(new RoadBuilderCard()); target.addDevCard(roadBuilder); Assert.IsFalse(target.devCardsContains("yearOfPlenty")); List<DevelopmentCard> yearOfPlenty = new List<DevelopmentCard>(); yearOfPlenty.Add(new YearOfPlentyCard()); target.addDevCard(yearOfPlenty); target.removeDevCard("knight"); Assert.IsFalse(target.devCardsContains("knight")); }
public RemoveCardsForm(Player p, GameScreen gs) { this.player = p; this.gameScreen = gs; this.hand = p.getHand(); InitializeComponent(); updateLabels(); updateComboBoxes(); }
public void TestAddDevCard() { var target = new Hand(); List<DevelopmentCard> cards = new List<DevelopmentCard>(); cards.Add(new Knight()); cards.Add(new MonopolyCard()); cards.Add(new VictoryPointCard()); cards.Add(new RoadBuilderCard()); cards.Add(new YearOfPlentyCard()); target.addDevCard(cards); Assert.AreEqual(5, target.getDevCardCount()); }
public void TestDevCardsContains() { var target = new Hand(); List<DevelopmentCard> cards = new List<DevelopmentCard>(); cards.Add(new Knight()); cards.Add(new MonopolyCard()); cards.Add(new VictoryPointCard()); cards.Add(new RoadBuilderCard()); cards.Add(new YearOfPlentyCard()); target.addDevCard(cards); Assert.AreEqual(5, target.getDevCardCount()); Assert.IsTrue(target.devCardsContains("knight")); Assert.IsTrue(target.devCardsContains("monopoly")); Assert.IsTrue(target.devCardsContains("victoryPoint")); Assert.IsTrue(target.devCardsContains("roadBuilder")); Assert.IsTrue(target.devCardsContains("yearOfPlenty")); }
public void testConstructor() { var hand = new Hand(); Assert.NotNull(hand); }
public void TestThatResourcesGetModified() { Hand hand = new Hand(); hand.modifyResources("ore", 3); Assert.AreEqual(3, hand.getOre()); hand.modifyResources("wool", 2); Assert.AreEqual(2, hand.getWool()); hand.modifyResources("lumber", 12); Assert.AreEqual(12, hand.getLumber()); hand.modifyResources("grain", 33); Assert.AreEqual(33, hand.getGrain()); hand.modifyResources("brick", 102); Assert.AreEqual(102, hand.getBrick()); }
public void TestThatHandHasDevelopmentCardResources_Boundary() { Hand hand = new Hand(); // At first it does not have sufficient resources Assert.False(hand.hasDevCardResources()); // Now give it the necessary resources hand.modifyWool(1); hand.modifyGrain(1); hand.modifyOre(1); Assert.True(hand.hasDevCardResources()); }
public void TestThatHandHasDevelopmentCardResources_Average() { Hand hand = new Hand(); hand.modifyWool(5); hand.modifyGrain(5); hand.modifyOre(5); Assert.True(hand.hasDevCardResources()); }
public void TestGetResource() { var target = new Hand(); target.modifyBrick(2); target.modifyGrain(3); target.modifyLumber(4); target.modifyOre(5); target.modifyWool(6); Assert.AreEqual(2, target.getResource("brick")); Assert.AreEqual(3, target.getResource("grain")); Assert.AreEqual(4, target.getResource("lumber")); Assert.AreEqual(5, target.getResource("ore")); Assert.AreEqual(6, target.getResource("wool")); }
public void TestRemoveVictoryPointThrowsWhenPlayerHasNoVictoryPointCards() { var target = new Hand(); target.removeDevCard("victoryPoint"); }
public void TestRemoveRoadBuilderThrowsWhenPlayerHasNoRoadBuilderCards() { var target = new Hand(); target.removeDevCard("roadBuilder"); }
public void TestRemoveMonoplyThrowsWhenPlayerHasNoMonopolyCards() { var target = new Hand(); target.removeDevCard("monopoly"); }
public void TestRemoveKnightThrowsWhenPlayerHasNoKnights() { var target = new Hand(); target.removeDevCard("knight"); }
public void TestIncrementKnightsPlayed() { var target = new Hand(); Assert.AreEqual(0, target.getKnights()); target.incrementKnightsPlayed(); target.incrementKnightsPlayed(); Assert.AreEqual(2, target.getKnights()); }
public void TestGetResourceThrowsOnInvalidString() { var target = new Hand(); target.getResource("ice"); }
public void TestRemoveYearOfPlentyThrowsWhenPlayerHasNoYearOfPlentyCards() { var target = new Hand(); target.removeDevCard("yearOfPlenty"); }
private void dealFromBank(string resource, int amount, Hand hand) { hand.modifyResources(resource, amount); bank.modifyResource(resource, -amount); }
public void TestDevCardsContainsReturnsFalseWhenThereAreNoDevCardsInHand() { var target = new Hand(); Assert.IsFalse(target.devCardsContains("buffalo")); }