示例#1
0
        public void GetNextSyncSeasonForRetiredPlayer()
        {
            var playerRow = new PlayerRow
            {
                ID          = "testte01",
                FeedUrl     = "https://www.basketball-reference.com/players/j/",
                Name        = "test test",
                FirstSeason = 2000,
                LastSeason  = 2010,
            };

            Assert.AreEqual(playerRow.FirstSeason, playerRow.GetNextSyncSeason());

            playerRow.LastSyncSeason = playerRow.FirstSeason;
            Assert.AreEqual(playerRow.FirstSeason + 1, playerRow.GetNextSyncSeason());

            playerRow.LastSyncSeason = playerRow.LastSeason;
            Assert.AreEqual(playerRow.FirstSeason, playerRow.GetNextSyncSeason());
        }
示例#2
0
        public void GetNextSyncSeasonForActivePlayer()
        {
            var utcNow    = DateTime.UtcNow;
            var playerRow = new PlayerRow
            {
                ID          = "testte01",
                FeedUrl     = "https://www.basketball-reference.com/players/j/",
                Name        = "test test",
                FirstSeason = utcNow.Year - 10,
                LastSeason  = utcNow.Year,
            };

            Assert.AreEqual(playerRow.FirstSeason, playerRow.GetNextSyncSeason());

            playerRow.LastSyncSeason = playerRow.FirstSeason;
            Assert.AreEqual(playerRow.FirstSeason + 1, playerRow.GetNextSyncSeason());

            playerRow.LastSyncSeason = playerRow.LastSeason;
            Assert.AreEqual(playerRow.LastSeason, playerRow.GetNextSyncSeason());
        }