Ejemplo n.º 1
0
        public void GivenTheDealersHandContainsTheFollowingCards(Table table)
        {
            var mapper = new TableObjectMapper();
            var game_builder = new GameBuilder().find_game_by_player_id(PlayerToken.player_id);
            var cards = new List<CardInHandRow>();
            foreach (var row in table.Rows)
                cards.Add(mapper.create_card_in_hand_row_from(row));

            game_builder.add_cards_to_dealers_hand(cards);

            var game = game_builder.build();

            DataBaseHelper.save_or_add(game);
        }
Ejemplo n.º 2
0
        public void GivenTheDeckContainsTheFollowingCards(Table table)
        {
            var mapper = new TableObjectMapper();
            var game_builder = new GameBuilder().find_game_by_player_id(PlayerToken.player_id);

            int card_position = 1;
            foreach(var row in table.Rows)
            {                
                game_builder.add_to_deck(mapper.create_deck_row_from(row, card_position));
                card_position++;
            }            

            var game = game_builder.build();

            DataBaseHelper.save_or_add<BlackJackTableRow>(game);
        }