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); }
public static List<TestResult> RunInsertTest(int runID, Framework framework, ITestSignature testSignature) { List<TestResult> results = new List<TestResult>(); TestResult result = new TestResult() { Run = runID, Framework = framework }; //TODO List<long> playerByIDResults = new List<long>(); playerByIDResults.Add(testSignature.Generate(NumSports, NumTeams, NumPlayers)); result.PlayerByIDMilliseconds = Math.Round(playerByIDResults.Average(), 2); //TODO results.Add(result); return results; }
public static void TestMethod(ITestSignature test, string method) { var iterations = 10; for (int i = 1; i <= iterations; i++) { var customerByCountryTime = test.GetCustomersByCountry("Germany"); TimeCountLogger.Info($"Query 1: || Iteration: {i}: || Elapsed Time: {customerByCountryTime}", method); } for (int i = 1; i <= iterations; i++) { var orerByCustomerTime = test.GetOrdersByCustomer("ANTON"); TimeCountLogger.Info($"Query 2: || Iteration: {i}: || Elapsed Time: {orerByCustomerTime}", method); } for (int i = 1; i <= iterations; i++) { var custAndOrdByEmpTime = test.GetCustomerAndOrdersByEmp(3); TimeCountLogger.Info($"Query 3: || Iteration: {i}: || Elapsed Time: {custAndOrdByEmpTime}", method); } }
public static List <TestResult> RunInsertTest(int runID, Framework framework, ITestSignature testSignature) { List <TestResult> results = new List <TestResult>(); TestResult result = new TestResult() { Run = runID, Framework = framework }; //TODO List <long> playerByIDResults = new List <long>(); playerByIDResults.Add(testSignature.Generate(NumSports, NumTeams, NumPlayers)); result.PlayerByIDMilliseconds = Math.Round(playerByIDResults.Average(), 2); //TODO results.Add(result); return(results); }