Esempio n. 1
0
        public bool AddMyArray([FromServices] IPokerService PokerService, Array pokerIdList)
        {
            var userId = HttpContext.Session.GetString("UserId");
            var result = PokerService.AddMyArray(pokerIdList, userId);

            return(result);
        }
Esempio n. 2
0
        public bool AddMyPoker([FromServices] IPokerService PokerService, string pokerId)
        {
            var userId = HttpContext.Session.GetString("UserId");
            var result = PokerService.AddMyPoker(pokerId, userId);

            return(result);
        }
        private void ValidateInitialProperties(IPokerService pokerService)
        {
            Assert.IsNotEmpty(Hands);

            for (var i = 0; i < Hands.Count; i++)
            {
                Assert.IsNotNull(Hands[i]);
                Assert.IsNotEmpty(Hands[i].Cards);
                Assert.AreEqual(5, Hands[i].Cards.Count);
                Assert.IsTrue(Hands[i].Cards.All(x => x != null));
            }

            Assert.IsNotNull(pokerService);
        }
        public void RunGetWinningHands(IPokerService pokerService)
        {
            try
            {
                ValidateInitialProperties(pokerService);

                var winningHands = pokerService.GetWinningHands(Hands).ToList();
                ValidateGetWinningHands(winningHands);
            }

            catch
            {
                Console.WriteLine($"Description: {Description}");
                throw;
            }
        }
Esempio n. 5
0
 public bool Login([FromServices] IPokerService PokerService, string UserId)
 {
     try
     {
         HttpContext.Session.SetString("UserId", UserId);
         var poker = PokerService.GetMyAll(UserId);
         if (poker.Count() == 0)
         {
             PokerService.AddMyPoker("3", UserId);
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 6
0
 public IEnumerable <Poker> GetAll([FromServices] IPokerService PokerService)
 {
     return(PokerService.GetAll());
 }
Esempio n. 7
0
        public IEnumerable <myPoker> GetMyAll([FromServices] IPokerService PokerService)
        {
            var userId = HttpContext.Session.GetString("UserId");

            return(PokerService.GetMyAll(userId));
        }
Esempio n. 8
0
 public Game(int round, int player, IPokerService pokerService)
 {
     _roundNum     = round;
     _playerNum    = player;
     _pokerService = pokerService;
 }
Esempio n. 9
0
 public void SetUp()
 {
     _pokerService = new PokerService();
 }