public void TestDepthChartExecution() { var teamCode = "MV"; var t = new NflTeam(teamCode); var sut = new DepthChartReport("2013", 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 TestAnalisePassingYardage() { var sut = new NflTeam("SL"); sut.LoadPassUnit(); Assert.IsTrue(sut.PassUnit.Quarterbacks.Count > 0); Utility.Announce(string.Format("Loaded {0} QBs", sut.PassUnit.Quarterbacks.Count)); sut.PassUnit.AnalyseQuarterbacks("2013", "12"); }
public void TestAnaliseReceptionYardage() { var sut = new NflTeam("KC"); sut.LoadPassUnit(); Assert.IsTrue(sut.PassUnit.Receivers.Count > 0); Utility.Announce(string.Format("Loaded {0} recivers", sut.PassUnit.Receivers.Count)); //sut.PassUnit.DumpUnit(); sut.PassUnit.AnalyseWideouts("2013", "12"); sut.PassUnit.AnalyseTightends("2013", "12"); }
public void TestPlayerPassingUnitGetsLoaded() { var sut = new NflTeam("JJ"); // dependancy on DB, thus an integration test sut.LoadPassUnit(); Assert.IsTrue(sut.PassUnit.Quarterbacks.Count > 0); Assert.IsTrue(sut.PassUnit.Receivers.Count > 0); Utility.Announce(string.Format(" Loaded {0} QBs", sut.PassUnit.Quarterbacks.Count)); Utility.Announce(string.Format(" Loaded {0} Receivers", sut.PassUnit.Receivers.Count)); Assert.IsFalse(sut.PassUnit.HasIntegrityError()); Utility.Announce("No integrity errors"); }
private string GenerateBody() { var bodyOut = new StringBuilder(); NflTeam = new NflTeam(TeamCode); NflTeam.LoadTeam(); PlayerCount = NflTeam.PlayerList.Count; TraceIt($" {TeamCode} Roster Count : {PlayerCount}"); bodyOut.AppendLine(NflTeam.RatingsOut() + " " + NflTeam.SeasonProjectionOut()); bodyOut.AppendLine(); bodyOut.AppendLine(NflTeam.ScheduleHeaderOut()); bodyOut.AppendLine(NflTeam.ScheduleOut()); bodyOut.AppendLine(NflTeam.ScoreCountsOut()); bodyOut.AppendLine(); bodyOut.AppendLine(); AppendPlayerLine(bodyOut, "QB"); AppendPlayerLine(bodyOut, "Q2"); AppendPlayerLine(bodyOut, "RB"); AppendPlayerLine(bodyOut, "R2"); AppendPlayerLine(bodyOut, "RR"); AppendPlayerLine(bodyOut, "3D"); AppendPlayerLine(bodyOut, "SH"); AppendPlayerLine(bodyOut, "FB"); AppendPlayerLine(bodyOut, "W1"); AppendPlayerLine(bodyOut, "W2"); AppendPlayerLine(bodyOut, "W3"); AppendPlayerLine(bodyOut, "TE"); AppendPlayerLine(bodyOut, "T2"); AppendPlayerLine(bodyOut, "PR"); AppendPlayerLine(bodyOut, "KR"); AppendPlayerLine(bodyOut, "PK"); AppendPlayerLine(bodyOut, "INJ"); AppendPlayerLine(bodyOut, "SUS"); AppendPlayerLine(bodyOut, "HO"); bodyOut.AppendLine(); bodyOut.AppendLine( $" {TeamCode} Roster Count : {PlayerCount}"); bodyOut.AppendLine(); bodyOut.AppendLine(); NflTeam.LoadPassUnit(); bodyOut.AppendLine( $"Pass Unit : ({NflTeam.PoRating()})"); var lines = NflTeam.PassUnit.DumpUnit(); foreach (var line in lines) { bodyOut.AppendLine(line); } NflTeam.LoadRushUnit(); bodyOut.AppendLine( $"Rush Unit : ({NflTeam.RoRating()})"); lines = NflTeam.RunUnit.DumpUnit(); foreach (var line in lines) { bodyOut.AppendLine(line); } return(bodyOut.ToString()); }