public void DEBCreateBracket_GeneratesFor20Players()
        {
            List <IPlayer> pList = new List <IPlayer>();

            for (int i = 0; i < 20; ++i)
            {
                Mock <IPlayer> moq = new Mock <IPlayer>();
                moq.Setup(p => p.Id).Returns(i + 3);
                pList.Add(moq.Object);
            }
            IBracket b = new DoubleElimBracket(pList);

            var           v        = b.GetRound(2);
            List <IMatch> roundOne = b.GetRound(1);

            Assert.AreEqual(4, roundOne.Count);
        }
        public void DEBSMGFWLR_DoesNotUpdateUpperBracketRound()
        {
            List <IPlayer> pList = new List <IPlayer>();

            for (int i = 0; i < 16; ++i)
            {
                Mock <IPlayer> moq = new Mock <IPlayer>();
                moq.Setup(p => p.Id).Returns(i);
                pList.Add(moq.Object);
            }
            IBracket b = new DoubleElimBracket(pList);

            int round = 2;

            b.SetMaxGamesForWholeLowerRound(round, 5);
            Assert.AreEqual(1, b.GetRound(round)[0].MaxGames);
        }
        public void DEBCreateBracket_AssignsMatchNumbersToLowerBracket()
        {
            List <IPlayer> pList = new List <IPlayer>();

            for (int i = 0; i < 4; ++i)
            {
                Mock <IPlayer> moq = new Mock <IPlayer>();
                moq.Setup(p => p.Id).Returns(i);
                pList.Add(moq.Object);
            }
            IBracket b = new DoubleElimBracket(pList);

            //b.CreateBracket();

            Assert.AreEqual(b.GetRound(b.NumberOfRounds)[0].MatchNumber + 1,
                            b.GetLowerRound(1)[0].MatchNumber);
        }
        public void DEBSMGFWR_UpdatesCorrectUpperBracketRound()
        {
            List <IPlayer> pList = new List <IPlayer>();

            for (int i = 0; i < 16; ++i)
            {
                Mock <IPlayer> moq = new Mock <IPlayer>();
                moq.Setup(p => p.Id).Returns(i);
                pList.Add(moq.Object);
            }
            IBracket b = new DoubleElimBracket(pList);

            int games = 5;
            int round = 2;

            b.SetMaxGamesForWholeRound(round, games);
            Assert.AreEqual(games, b.GetRound(round)[1].MaxGames);
        }