public void TestDepthChartExecution() { const string teamCode = "NE"; var t = new NflTeam(teamCode); var sut = new DepthChartReport("2015", teamCode); sut.Execute(); var isError = false; if (sut.HasIntegrityError()) { isError = true; sut.DumpErrors(); Utility.Announce(string.Format(" Need to fix Depth Chart {0}", t.Name)); } t.LoadRushUnit(); if (t.RushUnit.HasIntegrityError()) { isError = true; t.RushUnit.DumpUnit(); Utility.Announce(string.Format(" Need to fix Rushing Unit {0}", t.Name)); } t.LoadPassUnit(); if (t.PassUnit.HasIntegrityError()) { isError = true; t.PassUnit.DumpUnit(); Utility.Announce(string.Format(" Need to fix Passing Unit {0}", t.Name)); } Assert.IsFalse(isError); }
public DepthChartJob( IKeepTheTime timekeeper ) { Name = "Depth Charts"; Report = new DepthChartReport(timekeeper.CurrentSeason()); TimeKeeper = timekeeper; Logger = LogManager.GetCurrentClassLogger(); IsNflRelated = true; }
public void TestAllDepthCharts() { const string theSeason = "2015"; var errors = 0; var errorTeams = string.Empty; var s = new NflSeason( theSeason, true ); foreach (var t in s.TeamList) { var isError = false; var sut = new DepthChartReport( theSeason, t.TeamCode ); sut.Execute(); if (sut.HasIntegrityError()) { isError = true; sut.DumpErrors(); Utility.Announce(string.Format(" Need to fix Depth Chart {0}", t.Name)); } t.LoadRushUnit(); if (t.RushUnit.HasIntegrityError()) { isError = true; t.RushUnit.DumpUnit(); t.RushUnit.DumpErrors(); Utility.Announce(string.Format(" Need to fix Rushing Unit {0}", t.Name)); } t.LoadPassUnit(); if (t.PassUnit.HasIntegrityError()) { isError = true; t.PassUnit.DumpUnit(); t.PassUnit.DumpErrors(); Utility.Announce(string.Format(" Need to fix Passing Unit {0}", t.Name)); } if (isError) { errorTeams += t.TeamCode + ","; errors++; } } Utility.Announce(" -------------------------------------------------"); Utility.Announce(string.Format(" There are {0} broken teams - {1}", errors, errorTeams)); Utility.Announce(" -------------------------------------------------"); Assert.AreEqual(0, errors); }
public void TestDepthChartConstructor() { var sut = new DepthChartReport(); Assert.IsNotNull(sut); }
public void TestMoranNorrisIsNotStarter() { var role = "?"; var sut = new DepthChartReport("2016", "SF"); sut.Execute(); foreach (var p in sut.NflTeam.PlayerList) { var player = (NFLPlayer)p; if (p.ToString() != "Moran Norris") continue; role = player.PlayerRole; break; } Assert.AreNotEqual("S", role); }
public void TestDepthChartLoadsStarters() { var sut = new DepthChartReport("2016", "SF") {LeagueInFocus = "YH"}; sut.Execute(); Assert.IsTrue(sut.PlayerCount > 0); }