public bool AddMyArray([FromServices] IPokerService PokerService, Array pokerIdList) { var userId = HttpContext.Session.GetString("UserId"); var result = PokerService.AddMyArray(pokerIdList, userId); return(result); }
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; } }
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); } }
public IEnumerable <Poker> GetAll([FromServices] IPokerService PokerService) { return(PokerService.GetAll()); }
public IEnumerable <myPoker> GetMyAll([FromServices] IPokerService PokerService) { var userId = HttpContext.Session.GetString("UserId"); return(PokerService.GetMyAll(userId)); }
public Game(int round, int player, IPokerService pokerService) { _roundNum = round; _playerNum = player; _pokerService = pokerService; }
public void SetUp() { _pokerService = new PokerService(); }