public static List <TestResult> RunTests(int runID, Framework framework, ITestSignature testSignature) { List <TestResult> results = new List <TestResult>(); TestResult result = new TestResult() { Run = runID, Framework = framework }; List <long> playerByIDResults = new List <long>(); for (int i = 1; i <= NumPlayers; i++) { playerByIDResults.Add(testSignature.GetPlayerByID(i)); } result.PlayerByIDMilliseconds = Math.Round(playerByIDResults.Average(), 3); List <long> playersForTeamResults = new List <long>(); for (int i = 1; i <= NumTeams; i++) { playersForTeamResults.Add(testSignature.GetRosterByTeamID(i)); } result.PlayersForTeamMilliseconds = Math.Round(playersForTeamResults.Average(), 3); List <long> teamsForSportResults = new List <long>(); for (int i = 1; i <= NumSports; i++) { teamsForSportResults.Add(testSignature.GetTeamRostersForSport(i)); } result.TeamsForSportMilliseconds = Math.Round(teamsForSportResults.Average(), 3); results.Add(result); return(results); }
public static List<TestResult> RunTests(int runID, Framework framework, ITestSignature testSignature) { List<TestResult> results = new List<TestResult>(); TestResult result = new TestResult() { Run = runID, Framework = framework }; List<long> playerByIDResults = new List<long>(); for (int i = 1; i <= NumPlayers; i++) { playerByIDResults.Add(testSignature.GetPlayerByID(i)); } result.PlayerByIDMilliseconds = Math.Round(playerByIDResults.Average(), 2); List<long> playersForTeamResults = new List<long>(); for (int i = 1; i <= NumTeams; i++) { playersForTeamResults.Add(testSignature.GetPlayersForTeam(i)); } result.PlayersForTeamMilliseconds = Math.Round(playersForTeamResults.Average(), 2); List<long> teamsForSportResults = new List<long>(); for (int i = 1; i <= NumSports; i++) { teamsForSportResults.Add(testSignature.GetTeamsForSport(i)); } result.TeamsForSportMilliseconds = Math.Round(teamsForSportResults.Average(), 2); results.Add(result); return results; }
public static List <TestResult> RunTests(int runID, Framework framework, ITestSignature testSignature) { List <TestResult> results = new List <TestResult>(); TestResult result = new TestResult() { Run = runID, Framework = framework }; List <long> playerByIDResults = new List <long>(); for (int i = 1; i <= NumPlayers; i++) { var a = testSignature.GetPlayerByID(i); playerByIDResults.Add(a); } result.PlayerByIDMilliseconds = Math.Round(playerByIDResults.Average(), 3); /* * List<long> playersForTeamResults = new List<long>(); * for (int i = 1; i <= NumTeams; i++) * { * playersForTeamResults.Add(testSignature.GetRosterByTeamID(i)); * } * result.PlayersForTeamMilliseconds = Math.Round(playersForTeamResults.Average(), 3); * List<long> teamsForSportResults = new List<long>(); * for (int i = 1; i <= NumSports; i++) * { * teamsForSportResults.Add(testSignature.GetTeamRostersForSport(i)); * } * result.TeamsForSportMilliseconds = Math.Round(teamsForSportResults.Average(), 3); * */ List <long> createResults = new List <long>(); for (int i = 1; i <= NumPlayers; i++) { createResults.Add(testSignature.Create(i)); } result.CreateMilliseconds = Math.Round(createResults.Average(), 3); List <long> updateResults = new List <long>(); for (int i = 1; i <= NumPlayers; i++) { updateResults.Add(testSignature.Update(i)); } result.UpdateMilliseconds = Math.Round(updateResults.Average(), 3); List <long> deleteResults = new List <long>(); for (int i = 1; i <= NumPlayers; i++) { deleteResults.Add(testSignature.Delete(i)); } result.DeleteMilliseconds = Math.Round(deleteResults.Average(), 3); results.Add(result); return(results); }