public void TestTeamWinPercentage_GivenWith_TeamData_ShouldBe_ManyTeamValuesAndSortedDescendingByTeamWinsPercentage() { sut = new F1Stats(SampleData.Teams, new F1StatsWeightingStub()); var resultCollection = sut.TeamWinPercentage(); double highest = 0, current = 0; foreach (TeamValue team in resultCollection) { if (highest == 0) { highest = team.TeamWinsPercentage; } current = team.TeamWinsPercentage; if (highest != current) { Assert.IsTrue(highest > current); } highest = current; } }
public void TestTeamWinPercentage_GivenWith_TeamDataAndTeam5_ShouldBe_1TeamValueWithDriverWinPercentage() { sut = new F1Stats(SampleData.Teams, new F1StatsWeightingStub()); var resultCollection = sut.TeamWinPercentage(5); Assert.IsTrue(((List <TeamValue>)resultCollection)[0].DriverWinPercentage > 0); }
public void TestTeamWinPercentage_GivenWith_TeamDataAndTeam5_ShouldBe_1TeamValue() { sut = new F1Stats(SampleData.Teams, new F1StatsWeightingStub()); var resultCollection = sut.TeamWinPercentage(5); Assert.AreEqual(resultCollection.Count(), 1); }
public void TestTeamWinPercentage_GivenWith_TeamDataAndTeam9999_ShouldBe_EmptyList() { sut = new F1Stats(SampleData.Teams, new F1StatsWeightingStub()); var resultCollection = sut.TeamWinPercentage(9999); Assert.IsEmpty(resultCollection); }
public void TestTeamWinPercentage_GivenWith_TeamData_ShouldBe_ManyTeamValues() { sut = new F1Stats(SampleData.Teams, new F1StatsWeightingStub()); var resultCollection = sut.TeamWinPercentage(); Assert.IsTrue(resultCollection.Count() > 1); }
public void TestTeamWinPercentageEmptyList() { var value = f1stats.TeamWinPercentage(-1); if (value != null && value.Count() == 0) { // pass } else { throw new Exception("TestTeamWinPercentageEmptyList() failed"); } }