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 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); }