Exemplo n.º 1
0
        public int Run(PlayingCardDeck deck, CancellationToken cancellationToken)
        {
            var context = new AcesUpRunContext(deck, cancellationToken);
            var result  = Run(context);

            return(result);
        }
Exemplo n.º 2
0
        public void CardObjectEqualityCanBeTested()
        {
            var deck = new PlayingCardDeck(3);
            var card = deck.Card("5C");

            Assert.AreEqual(card, deck.Card("5C"));
        }
Exemplo n.º 3
0
        public void InitializeDeck()
        {
            var jokerlessDeck = new PlayingCardDeck();
            var deck = new PlayingCardDeck(3);

            Assert.AreEqual(0, jokerlessDeck.Count(x => x.Identity.IsJoker));
            Assert.AreEqual(3, deck.Count(x => x.Identity.IsJoker));
        }
Exemplo n.º 4
0
        public void DeckForJokerShouldNotHaveSixSpadesCard()
        {
            // Arrange
            var deck = new PlayingCardDeck(CardSuits.Default(), CardIdentities.JokerCardIdentities(), 2, true);

            // Assert
            Assert.IsFalse(deck.Any(x => x.Suit.Name == "S" && x.Identity.Name == "Six"));
        }
Exemplo n.º 5
0
        public void DeckForJokerShouldHaveThirtySixCards()
        {
            // Arrange
            var deck = new PlayingCardDeck(CardSuits.Default(), CardIdentities.JokerCardIdentities(), 2, true);

            // Assert
            Assert.AreEqual(36, deck.Count());
        }
Exemplo n.º 6
0
        public void DeckTest1()
        {
            PlayingCardDeck deckWithout = new PlayingCardDeck(1, false);
            PlayingCardDeck deckWith = new PlayingCardDeck(1, true);

            Assert.IsTrue(deckWithout.numberOfCardsRemaining == 52);
            Assert.IsTrue(deckWith.numberOfCardsRemaining == 54);
        }
Exemplo n.º 7
0
        public void DeckTest1()
        {
            PlayingCardDeck deckWithout = new PlayingCardDeck(1, false);
            PlayingCardDeck deckWith    = new PlayingCardDeck(1, true);

            Assert.IsTrue(deckWithout.numberOfCardsRemaining == 52);
            Assert.IsTrue(deckWith.numberOfCardsRemaining == 54);
        }
Exemplo n.º 8
0
        public void SortTest_NumberOfCardsRemainConstant()
        {
            var target = PlayingCardDeck.GetCards();

            var actual = PlayingCardDeck.Sort(target);

            Assert.AreEqual(target.Count(), actual.Count());
        }
Exemplo n.º 9
0
        public void ShuffleTest_NumberOfCardsRemainsConstant()
        {
            var target = PlayingCardDeck.GetCards();

            var actual = PlayingCardDeck.Shuffle(target);

            Assert.AreEqual(target.Count(), actual.Count());
            Assert.AreNotEqual(target, actual);
        }
Exemplo n.º 10
0
        private static void Run()
        {
            var deck = PlayingCardDeck.Standard52CardDeck();

            var program = new AcesUp(output: Console.Out);
            var result  = program.Run(deck);

            Console.WriteLine("AcesUp :: Result = {0}", result);
        }
Exemplo n.º 11
0
 public AcesUpRunContext(PlayingCardDeck deck, CancellationToken cancellationToken, bool hardMode = false)
 {
     Deck           = deck;
     Token          = cancellationToken;
     HardMode       = hardMode;
     MovingStrategy =
         new MoveCardBasedOnDirectlyUnderTopCard(
             new MoveFirstAvailableCardToEmptySpace()
             );
 }
Exemplo n.º 12
0
        public void CanCreate52Cards()
        {
            // arrange
            int expectedDeckCount = 52;

            // act
            PlayingCardDeck deck = new PlayingCardDeck();

            // assert
            Assert.Equal(expectedDeckCount, deck.Cards.Count);
        }
Exemplo n.º 13
0
    private PlayingCardDeck(PlayingCardDeck deck)
    {
        this.cards = new List <ICard>();

        foreach (var card in deck.cards)
        {
            this.cards.Add(card.CopyCard());
        }

        this.decksize = this.cards.Count;
    }
Exemplo n.º 14
0
        public (Participant, PlayingCardDeck) GetPlayerWithSevenCardHand()
        {
            var         deck   = new PlayingCardDeck();
            Participant player = new Player("Tester", deck, 2, 0);
            Table       table  = new Table("TableTester", deck, 5, 0);
            Judge       judge  = new Judge();

            player.GetHand(table);

            return(player, deck);
        }
Exemplo n.º 15
0
    private static void InitDecks()
    {
        fileMut.WaitOne();
        for (int i = 0; i < 101; i++)
        {
            IDeck toAdd = new PlayingCardDeck();
            toAdd.ShuffleDeck();
            constDecks.Add(toAdd);
        }
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create("./SkyNetData/ConstDecks.dat");

        bf.Serialize(file, constDecks);
        file.Close();
        fileMut.ReleaseMutex();
    }
Exemplo n.º 16
0
        private void GameStart()
        {
            Deck = new PlayingCardDeck();

            Deck.Shuffle();
            StartShufflePlayer();

            PlayersHandTotal = 0;
            PlayersHand.Clear();

            DealersHandTotal = 0;
            DealersHand.Clear();

            ButtonHit.Enabled   = true;
            ButtonStick.Enabled = true;

            LabelPlayerScore.Text = "Players score: " + PlayerGameScore.ToString();
            LabelDealerScore.Text = "Dealers score: " + DealerGameScore.ToString();

            SetDealersCardsFaceDown(DealerFirstCard);
            SetDealersCardsFaceDown(DealerSecondCard);
            DealerFirstCard.Alpha  = 1;
            DealerSecondCard.Alpha = 1;
            DealerThirdCard.Alpha  = 0;
            DealerFourthCard.Alpha = 0;
            DealerFifthCard.Alpha  = 0;

            PlayerFirstCard.Alpha  = 1;
            PlayerSecondCard.Alpha = 1;
            PlayerThirdCard.Alpha  = 0;
            PlayerFourthCard.Alpha = 0;
            PlayerFifthCard.Alpha  = 0;

            PlayersHand.Add(Deck.RemoveTopCard());
            DealersHand.Add(Deck.RemoveTopCard());
            PlayersHand.Add(Deck.RemoveTopCard());
            DealersHand.Add(Deck.RemoveTopCard());

            LabelDealersHandTotal.Text = "Dealers hand total: " + DealersHandTotal;

            PrintPlayerHand(PlayersHand);

            PlayersHandTotal           = UpdateScore(PlayersHand);
            LabelPlayersHandTotal.Text = "Players hand total: " + PlayersHandTotal.ToString();

            LabelConvoText.Text = "Players turn";
        }
Exemplo n.º 17
0
        public void CanCreatePlayer()
        {
            // arrange
            var deck          = new PlayingCardDeck();
            var name          = "Viktor";
            var numberOfCards = 2;
            var id            = 0;

            // act
            Participant player = new Player("Viktor", deck, 2, 0);

            // assert
            Assert.NotNull(player);
            Assert.Equal(name, player.Name);
            Assert.Equal(numberOfCards, player.Cards.Count);
            Assert.Equal(id, player.Id);
        }
Exemplo n.º 18
0
        public void CanAddCardToBottomOfDeck()
        {
            // arrange
            var deck = new PlayingCardDeck();
            var expectedNewQueueDeckCount = 53;
            var card = new PlayingCard {
                Face = Face.Ace, Suit = Suit.Spades
            };

            // act
            Deal.AddCardToBottom(deck, card);

            // assert
            Assert.Equal(Suit.Spades, deck.Cards[0].Suit);
            Assert.Equal(Face.Ace, deck.Cards[0].Face);
            Assert.Equal(expectedNewQueueDeckCount, deck.Cards.Count);
        }
Exemplo n.º 19
0
        public void CanCreateTable()
        {
            // arrange
            var deck          = new PlayingCardDeck();
            var name          = "Table";
            var numberOfCards = 5;
            var id            = 0;

            // act
            Participant table = new Table("Table", deck, 5, 0);

            // assert
            Assert.NotNull(table);
            Assert.Equal(name, table.Name);
            Assert.Equal(numberOfCards, table.Cards.Count);
            Assert.Equal(id, table.Id);
        }
Exemplo n.º 20
0
        public void CardIsRemovedFromDeckWhenDealt()
        {
            // arrange
            int  expectedCount = 51;
            var  deck          = new PlayingCardDeck();
            bool cardIsRemoved = true;
            var  dealtCard     = Deal.DealNCards(deck, 1).Single();

            // act
            for (int i = 0; i < deck.Cards.Count; i++)
            {
                if (deck.Cards[i] == dealtCard)
                {
                    cardIsRemoved = false;
                }
            }

            // assert
            Assert.True(cardIsRemoved);
            Assert.Equal(expectedCount, deck.Cards.Count);
        }
Exemplo n.º 21
0
        public void CardsAreRemovedFromDeckWhenAddingMultipleOpponents()
        {
            // arrange
            var deck              = new PlayingCardDeck();
            int id                = 0;
            int expectedId        = 6;
            int expectedCardsLeft = 35;

            // act
            Participant player = new Player("player", deck, 2, 0);

            for (int i = 1; i <= 5; i++)
            {
                id = i;
                Participant opponent = new Player("opponent", deck, 2, id);
            }
            Participant table = new Table("table", deck, 5, ++id);

            // assert
            Assert.Equal(expectedId, table.Id);
            Assert.Equal(expectedCardsLeft, deck.Cards.Count);
        }
Exemplo n.º 22
0
        public void TwoShuffledDecksWillNotBeTheSame()
        {
            // arrange
            bool            isSame      = true;
            PlayingCardDeck deck        = new PlayingCardDeck();
            PlayingCardDeck anotherDeck = new PlayingCardDeck();

            // act
            for (int i = 0; i < deck.Cards.Count; i++)
            {
                if (deck.Cards[i].Suit != anotherDeck.Cards[i].Suit ||
                    deck.Cards[i].Face != anotherDeck.Cards[i].Face)
                {
                    isSame = false;
                }
            }

            // assert
            Assert.False(isSame);
            Assert.Equal(52, deck.Cards.Count);
            Assert.Equal(52, anotherDeck.Cards.Count);
        }
Exemplo n.º 23
0
        protected virtual int RunInstance(Action <AcesUp.AcesUpRunContext> configure, TextWriter output, int instanceId)
        {
            var deck = PlayingCardDeck.Standard52CardDeck();

            deck.Shuffle();

            var context = new AcesUp.AcesUpRunContext(deck, CancellationToken.None);

            configure?.Invoke(context);

            var program = new AcesUp(output, s =>
            {
                if (instanceId > 1)
                {
                    return($"[{instanceId:D5}] :: {s}");
                }
                return(s);
            });

            var points = program.Run(context);

            //Console.WriteLine("AcesUp :: Result = {0}", points);
            return(points);
        }
Exemplo n.º 24
0
        public void SortTest_DeckIsSorted()
        {
            var expected = new List <PlayingCard>()
            {
                new PlayingCard(CardValue.Ace, CardSuit.Hearts),
                new PlayingCard(CardValue.Two, CardSuit.Hearts),
                new PlayingCard(CardValue.Three, CardSuit.Hearts),
                new PlayingCard(CardValue.Four, CardSuit.Hearts),
                new PlayingCard(CardValue.Five, CardSuit.Hearts),
                new PlayingCard(CardValue.Six, CardSuit.Hearts),
                new PlayingCard(CardValue.Seven, CardSuit.Hearts),
                new PlayingCard(CardValue.Eight, CardSuit.Hearts),
                new PlayingCard(CardValue.Nine, CardSuit.Hearts),
                new PlayingCard(CardValue.Ten, CardSuit.Hearts),
                new PlayingCard(CardValue.Jack, CardSuit.Hearts),
                new PlayingCard(CardValue.Queen, CardSuit.Hearts),
                new PlayingCard(CardValue.King, CardSuit.Hearts),
                new PlayingCard(CardValue.Ace, CardSuit.Clubs),
                new PlayingCard(CardValue.Two, CardSuit.Clubs),
                new PlayingCard(CardValue.Three, CardSuit.Clubs),
                new PlayingCard(CardValue.Four, CardSuit.Clubs),
                new PlayingCard(CardValue.Five, CardSuit.Clubs),
                new PlayingCard(CardValue.Six, CardSuit.Clubs),
                new PlayingCard(CardValue.Seven, CardSuit.Clubs),
                new PlayingCard(CardValue.Eight, CardSuit.Clubs),
                new PlayingCard(CardValue.Nine, CardSuit.Clubs),
                new PlayingCard(CardValue.Ten, CardSuit.Clubs),
                new PlayingCard(CardValue.Jack, CardSuit.Clubs),
                new PlayingCard(CardValue.Queen, CardSuit.Clubs),
                new PlayingCard(CardValue.King, CardSuit.Clubs),
                new PlayingCard(CardValue.Ace, CardSuit.Diamonds),
                new PlayingCard(CardValue.Two, CardSuit.Diamonds),
                new PlayingCard(CardValue.Three, CardSuit.Diamonds),
                new PlayingCard(CardValue.Four, CardSuit.Diamonds),
                new PlayingCard(CardValue.Five, CardSuit.Diamonds),
                new PlayingCard(CardValue.Six, CardSuit.Diamonds),
                new PlayingCard(CardValue.Seven, CardSuit.Diamonds),
                new PlayingCard(CardValue.Eight, CardSuit.Diamonds),
                new PlayingCard(CardValue.Nine, CardSuit.Diamonds),
                new PlayingCard(CardValue.Ten, CardSuit.Diamonds),
                new PlayingCard(CardValue.Jack, CardSuit.Diamonds),
                new PlayingCard(CardValue.Queen, CardSuit.Diamonds),
                new PlayingCard(CardValue.King, CardSuit.Diamonds),
                new PlayingCard(CardValue.Ace, CardSuit.Spades),
                new PlayingCard(CardValue.Two, CardSuit.Spades),
                new PlayingCard(CardValue.Three, CardSuit.Spades),
                new PlayingCard(CardValue.Four, CardSuit.Spades),
                new PlayingCard(CardValue.Five, CardSuit.Spades),
                new PlayingCard(CardValue.Six, CardSuit.Spades),
                new PlayingCard(CardValue.Seven, CardSuit.Spades),
                new PlayingCard(CardValue.Eight, CardSuit.Spades),
                new PlayingCard(CardValue.Nine, CardSuit.Spades),
                new PlayingCard(CardValue.Ten, CardSuit.Spades),
                new PlayingCard(CardValue.Jack, CardSuit.Spades),
                new PlayingCard(CardValue.Queen, CardSuit.Spades),
                new PlayingCard(CardValue.King, CardSuit.Spades),
            };

            var actual = PlayingCardDeck.Sort(PlayingCardDeck.GetCards());

            Assert.AreEqual(expected.Count(), actual.Count());
            Assert.IsTrue(Enumerable.SequenceEqual(expected, actual));
        }
Exemplo n.º 25
0
 public Dealer()
 {
     this._cardsForEachRound = Config.NumOfCardsInEachRound;
     this._deck = new PlayingCardDeck(CardSuits.Default(), CardIdentities.JokerCardIdentities(), 2, true);
 }
Exemplo n.º 26
0
        private void PlayGame()
        {
            score = 0;

            deck = new PlayingCardDeck();
            deck.Shuffle();
            bool done = false;

            while (!done)
            {
                Console.Clear();

                bool winner = false;
                playerCard   = deck.GetTopCard();
                computerCard = deck.GetTopCard();

                Console.WriteLine("Computer:");
                pcp.PrintCard(computerCard);

                Console.WriteLine();
                Console.WriteLine("Is your card higher or lower? (x to exit)");
                Console.WriteLine();
                Console.WriteLine("a) Higher");
                Console.WriteLine("b) Lower");
                Console.WriteLine("c) Tie");

                List <ConsoleKey> allowedKeys = new List <ConsoleKey>()
                {
                    ConsoleKey.A, ConsoleKey.B, ConsoleKey.C, ConsoleKey.X
                };
                ConsoleKey answer;
                string     userGuess = "";

                do
                {
                    answer = Console.ReadKey(true).Key;
                    if (!allowedKeys.Contains(answer))
                    {
                        ch.Red("That key is not allowed.");
                        ch.BlankLine();
                    }
                } while (!allowedKeys.Contains(answer));

                switch (answer)
                {
                case ConsoleKey.A:
                    winner    = (int)playerCard.Value > (int)computerCard.Value ? true : false;
                    userGuess = "Higher";
                    break;

                case ConsoleKey.B:
                    winner    = (int)playerCard.Value < (int)computerCard.Value ? true : false;
                    userGuess = "Lower";
                    break;

                case ConsoleKey.C:
                    winner    = (int)playerCard.Value == (int)computerCard.Value ? true : false;
                    userGuess = "Tie";
                    break;

                case ConsoleKey.X:
                    done = true;
                    break;

                default:
                    break;
                }

                if (!done)
                {
                    Console.Clear();
                    Console.WriteLine("Computer:");
                    pcp.PrintCard(computerCard);
                    Console.WriteLine("Player:");
                    pcp.PrintCard(playerCard);

                    if (winner)
                    {
                        Console.WriteLine("Correct!");
                        score++;
                    }
                    else
                    {
                        Console.WriteLine("Incorrect guess");
                    }
                    Console.WriteLine("Your guess: " + userGuess);
                    Console.WriteLine("Score: " + score);
                    Console.WriteLine("Cards left in deck: " + deck.Length);

                    if (deck.Length == 0)
                    {
                        done = true;
                        ch.PressKeyToContinue();
                        Console.Clear();
                        Console.WriteLine("Game over!");
                        Console.WriteLine("You got " + score + " points out of 26 possible");

                        if (MainApp.isLoggedIn)
                        {
                            UserScore userScore = dataAccess.GetUserScore(MainApp.currentUser, GameId);
                            int       highscore = userScore.Score;

                            if (score > highscore)
                            {
                                userScore.Score = score;
                                dataAccess.UpdateUserScore(userScore);
                                Console.WriteLine();
                                Console.WriteLine($"New highscore! Your previous highscore was {highscore} points.");
                            }
                            else
                            {
                                Console.WriteLine($"Too bad, you didn't beat your highscore. Your highscore is {highscore} points");
                            }
                        }
                    }
                    ch.PressKeyToContinue();
                }
            }
            Console.WriteLine();
        }
Exemplo n.º 27
0
 protected virtual void Awake()
 {
     Deck = new PlayingCardDeck(true);
 }
 public Table(string name, PlayingCardDeck deck, int numberOfCards, int id) : base(name, deck, numberOfCards, id)
 {
 }
Exemplo n.º 29
0
        public void ShouldGetDeckInOrderAndReturn52CardsCorrectlyFormatted()
        {
            var encapsulation = new PlayingCardDeck();

            Assert.Equal(
                new[]
            {
                "ace of clubs",
                "2 of clubs",
                "3 of clubs",
                "4 of clubs",
                "5 of clubs",
                "6 of clubs",
                "7 of clubs",
                "8 of clubs",
                "9 of clubs",
                "10 of clubs",
                "jack of clubs",
                "queen of clubs",
                "king of clubs",
                "ace of diamonds",
                "2 of diamonds",
                "3 of diamonds",
                "4 of diamonds",
                "5 of diamonds",
                "6 of diamonds",
                "7 of diamonds",
                "8 of diamonds",
                "9 of diamonds",
                "10 of diamonds",
                "jack of diamonds",
                "queen of diamonds",
                "king of diamonds",
                "ace of hearts",
                "2 of hearts",
                "3 of hearts",
                "4 of hearts",
                "5 of hearts",
                "6 of hearts",
                "7 of hearts",
                "8 of hearts",
                "9 of hearts",
                "10 of hearts",
                "jack of hearts",
                "queen of hearts",
                "king of hearts",
                "ace of spades",
                "2 of spades",
                "3 of spades",
                "4 of spades",
                "5 of spades",
                "6 of spades",
                "7 of spades",
                "8 of spades",
                "9 of spades",
                "10 of spades",
                "jack of spades",
                "queen of spades",
                "king of spades"
            },
                encapsulation.CreateNewDeckOfPlayingCards());
        }
Exemplo n.º 30
0
        public void ShouldGetDeckInOrderAndReturn52CardsCorrectlyFormatted()
        {
            var deck        = new PlayingCardDeck();
            var cards       = deck.SetCards();
            var deckInOrder = deck.getDeck(cards);

            List <PlayingCard> expected = new List <PlayingCard>()
            {
                new PlayingCard {
                    CardValue = "ace", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "2", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "3", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "4", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "5", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "6", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "7", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "8", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "9", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "10", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "jack", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "queen", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "king", CardSuit = "clubs"
                },
                new PlayingCard {
                    CardValue = "ace", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "2", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "3", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "4", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "5", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "6", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "7", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "8", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "9", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "10", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "jack", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "queen", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "king", CardSuit = "diamonds"
                },
                new PlayingCard {
                    CardValue = "ace", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "2", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "3", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "4", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "5", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "6", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "7", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "8", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "9", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "10", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "jack", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "queen", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "king", CardSuit = "hearts"
                },
                new PlayingCard {
                    CardValue = "ace", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "2", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "3", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "4", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "5", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "6", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "7", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "8", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "9", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "10", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "jack", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "queen", CardSuit = "spades"
                },
                new PlayingCard {
                    CardValue = "king", CardSuit = "spades"
                }
            };

            Assert.Equal(expected, deckInOrder);
        }
Exemplo n.º 31
0
        public void GetCardsTest_ByDefault_ReturnsStandardDeckOfCards()
        {
            var target = PlayingCardDeck.GetCards();

            Assert.AreEqual(52, target.Count());
        }
Exemplo n.º 32
0
        public int Run(PlayingCardDeck deck)
        {
            var result = Run(deck, CancellationToken.None);

            return(result);
        }