public void Should_NOT_refill_draw_deck_from_discards_when_empty() { var drawDeck = new DrawDeck(new List<ICard> { _copper, _estate }, _discardPile); drawDeck.TopCard.MoveTo(_discardPile); drawDeck.TopCard.MoveTo(_discardPile); drawDeck.CardCount.ShouldEqual(0); }
public void Should_replace_top_card_when_moved() { var drawDeck = new DrawDeck(new List<ICard> { _copper, _estate }, _discardPile); drawDeck.TopCard.ShouldEqual(_copper); drawDeck.TopCard.MoveTo(_discardPile); drawDeck.TopCard.ShouldEqual(_estate); }
public void Should_add_cards_passed_via_constructor() { var drawDeck = new DrawDeck(new List<ICard> { _copper, _estate }, _discardPile); drawDeck.CardCount.ShouldEqual(2); _copper.CurrentZone.ShouldEqual(drawDeck); _estate.CurrentZone.ShouldEqual(drawDeck); }
public void Should_refill_draw_deck_from_discards_when_card_required() { var drawDeck = new DrawDeck(new List<ICard> { _copper, _estate }, _discardPile); var hand = new Hand(); // First move the copper to the discard pile drawDeck.TopCard.MoveTo(_discardPile); // Next move the estate to the hand drawDeck.TopCard.MoveTo(hand); drawDeck.TopCard.ShouldEqual(_copper); }
public Player(string name, IEnumerable<ICard> startingDeck) { Id = Guid.NewGuid(); Name = name; Discards = new DiscardPile(); Deck = new DrawDeck(startingDeck, Discards); Deck.Shuffle(); Hand = new Hand(); DrawCards(5); PlayArea = new PlayArea(); }
public Player(string name, IEnumerable <ICard> startingDeck) { Id = Guid.NewGuid(); Name = name; Discards = new DiscardPile(); Deck = new DrawDeck(startingDeck, Discards); Deck.Shuffle(); Hand = new Hand(); DrawCards(5); PlayArea = new PlayArea(); }
public void Should_shuffle_deck_after_being_refilled() { var cards = new List<ICard>(); 15.Times(() => cards.Add(new Copper())); 15.Times(() => cards.Add(new Estate())); var drawDeck = new DrawDeck(cards, _discardPile); // Move all the cards to the discard pile drawDeck.MoveAll(_discardPile); // Peek at the top card to trigger a shuffle var topCard = drawDeck.TopCard; var cardsAfterShuffle = new List<ICard>(); 30.Times(() => { cardsAfterShuffle.Add(drawDeck.TopCard); drawDeck.TopCard.MoveTo(_discardPile); }); Assert.AreNotEqual(cards, cardsAfterShuffle); }
public DeckViewModel(DrawDeck deck) { CountDescription = deck.CardCount.ToString(); IsEmpty = deck.CardCount == 0; }