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 TestRushingUnitContainsGoallineBack() { var sut = new NflTeam("SF"); sut.LoadRushUnit(); Assert.IsNotNull(sut.RushUnit.GoalLineBack); Utility.Announce(string.Format("GoalLine Back is {0}", sut.RushUnit.GoalLineBack.PlayerName)); }
public void TestGetShortYardageBack() { var sut = new NflTeam("AF"); sut.LoadRushUnit(); var sh = sut.RushUnit.GetShortYardageBack("2013", "12", "AF"); Assert.AreEqual("JACKST02", sh); }
public void TestPlayerRushingUnitGetsLoaded() { var sut = new NflTeam("AC"); sut.LoadRushUnit(); Assert.IsTrue(sut.RushUnit.Runners.Count > 0); Assert.IsTrue(sut.RushUnit.Runners.Count < 10, string.Format("{0} runners", sut.RushUnit.Runners.Count)); Utility.Announce(string.Format("Loaded {0} runners", sut.RushUnit.Runners.Count)); Assert.IsFalse(sut.RushUnit.HasIntegrityError()); Utility.Announce("No integrity errors"); }
public void TestLoadUnitCarries() { var sut = new NflTeam("SD"); sut.LoadRushUnit(); Assert.IsTrue(sut.RushUnit.Runners.Count > 0); Assert.IsTrue(sut.RushUnit.Runners.Count < 10, string.Format("{0} runners", sut.RushUnit.Runners.Count)); Utility.Announce(string.Format("Loaded {0} runners", sut.RushUnit.Runners.Count)); //Assert.IsFalse(sut.RushUnit.HasIntegrityError()); //sut.RushUnit.DumpUnit(); sut.RushUnit.LoadCarries("2013", "12"); }
private void RunningUnit( AceRepository aceRepository, List <string> teamLines, string week, NflTeam t) { t.LoadRushUnit(); teamLines.Add("Runningbacks" + Environment.NewLine); teamLines.AddRange(t.RunUnit.LoadCarries(Season, week)); teamLines.Add(Environment.NewLine); if (t.RunUnit.IsAceBack && t.RunUnit.AceBack.TotStats.Touches > 10) { AddAceLine(t.RunUnit.AceBack, aceRepository); } teamLines.Add($"Approach :{t.RunUnit.DetermineApproach()}"); teamLines.Add(Environment.NewLine); }
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()); }