Пример #1
0
        public async void GenericPokerCardsRandomNumberGenerator_GenerateIntegersAsync_Should_Contain_1_Through_52(int input)
        {
            // act
            var numbers = await generator.GenerateIntegersAsync();

            // assert
            numbers.Should().Contain(input);
        }
Пример #2
0
        /// <summary>
        /// Generate a shuffled standard 52-card poker deck.
        /// </summary>
        public virtual async Task ShuffleAsync()
        {
            _isShuffling = true;

            try
            {
                var results = await _random.GenerateIntegersAsync();

                CardDeck = results.Select(x => new Card((CardType)x));
            }
            finally
            {
                _isShuffling = false;
            }
        }