Exemple #1
0
        public void Detector_CanDetectNewbiesToOpenSeason()
        {
            var result = _sut.NewbiesForWeek(0);

            Console.WriteLine($"{result.Count} newbies, cuts, holdouts or rebids");
            foreach (var item in result)
            {
                Console.WriteLine(item);
            }
            Assert.IsTrue(result.Count > 0);
        }
        public int ShowNewbieFreeAgents(int weekNo)
        {
            var result = _newPlayerDetector.NewbiesForWeek(weekNo);

            Console.WriteLine($"{result.Count} newbies, cuts, holdouts or rebids            {Season}        {Season + 1}");
            var sortedPlayers = result.OrderBy(r => r.GridstatsPos);
            var lastPosition  = "69";

            foreach (var player in sortedPlayers)
            {
                if (player.GridstatsPos != lastPosition)
                {
                    Console.WriteLine();
                    lastPosition = player.GridstatsPos;
                }

                var gameLog = GameLogService.GameLogFor(
                    Season.ToString(),
                    player.Name,
                    player.GridstatsPos,
                    sendToConsole: false);
                var nextLog = GameLogService.GameLogFor(
                    (Season + 1).ToString(),
                    player.Name,
                    player.GridstatsPos,
                    sendToConsole: false);

                gameLog.FilterOn(WeeksLeft);
                var accumulatedLog = gameLog.Add(nextLog);
                Console.WriteLine(
                    $@"{
                        player
                        }   {
                        gameLog.TotalStats(player.GridstatsPos)
                        }   {
                        nextLog.TotalStats(player.GridstatsPos)
                        }   {
                        accumulatedLog.TotalStats(player.GridstatsPos)
                        }  ({accumulatedLog.Value(),3})");
            }
            return(sortedPlayers.Count());
        }