Exemple #1
0
        public void Add()
        {
            var discardPile = new CardTestVisitor();

            _discard.Accept(discardPile);

            Assert.AreEqual(1, discardPile.Count);
            Assert.AreEqual(1, discardPile.UniqueCount);
        }
        public void Result()
        {
            var discardPile = new Discard();

            discardPile.Add(new Card(Suit.Clubs, Value.Eight));
            discardPile.Add(new Card(Suit.Diamonds, Value.Seven));
            discardPile.Add(new Card(Suit.Diamonds, Value.Ace));

            discardPile.Accept(_discardPileVisitor);

            Assert.AreEqual(3, _discardPileVisitor.Result().Count);
            Assert.AreEqual(Value.Ace, _discardPileVisitor.Result().Peek().Value);
            Assert.AreEqual(Suit.Diamonds, _discardPileVisitor.Result().Peek().Suit);
        }
Exemple #3
0
 public void Accept(DiscardPileVisitor visitor)
 {
     _discard.Accept(visitor);
 }