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

            for (int i = 0; i < 9; ++i)
            {
                Mock <IPlayer> moq = new Mock <IPlayer>();
                moq.Setup(p => p.Id).Returns(i + 1);
                pList.Add(moq.Object);
            }
            IBracket b = new SwissBracket(pList);
            int      matchesPerRound = b.GetRound(1).Count;

            for (int i = 0; i < 2; ++i)
            {
                for (int n = 1; n <= matchesPerRound; ++n)
                {
                    b.SetMatchWinner(n + (i * matchesPerRound), PlayerSlot.Defender);
                }
            }

            b.ResetMatches();
            int rIndex = b.Rankings.FindIndex(r => r.Id == b.Players[0].Id);

            Assert.AreEqual(1, b.Rankings[rIndex].Wins);
        }
        public void SwissResetMatches_RemovesPlayersFromAllMatchesAfterFirstRound()
        {
            List <IPlayer> pList = new List <IPlayer>();

            for (int i = 0; i < 32; ++i)
            {
                Mock <IPlayer> moq = new Mock <IPlayer>();
                moq.Setup(p => p.Id).Returns(i + 1);
                pList.Add(moq.Object);
            }
            IBracket b = new SwissBracket(pList);
            int      matchesPerRound = b.GetRound(1).Count;

            for (int i = 0; i < 3; ++i)
            {
                for (int n = 1; n <= matchesPerRound; ++n)
                {
                    b.SetMatchWinner(n + (i * matchesPerRound), PlayerSlot.Defender);
                }
            }

            b.ResetMatches();
            int matchesWithPlayers = 0;

            for (int n = 1; n < b.NumberOfMatches; ++n)
            {
                if (!(b.GetMatch(n).Players.Contains(null)))
                {
                    ++matchesWithPlayers;
                }
            }
            Assert.AreEqual(matchesPerRound, matchesWithPlayers);
        }