private IEnumerable<Result> GetResults(string sql, PlanDefinition testPlan)
 {
     var sqlConnection = new SqlConnection(connectionString);
     sqlConnection.Open();
     var enumerable = sqlConnection.Query<Result>(sql, new {TestPlan = testPlan.Id} );
     sqlConnection.Close();
     return enumerable;
 }
        private GraphViewModel GetResultsFor(PlanDefinition definition)
        {
            var dailyResults = resultsRepository.GetDailyResultsForPerformanceTest(definition);
            var heartBeatResults = resultsRepository.GetHeartBeatResultsForPerformanceTest(definition);

            var dailyLines = lineMapper.MapToLines(dailyResults);
            var heartBeatLines = lineMapper.MapToLines(heartBeatResults);

            return new GraphViewModel(definition.Name, dailyLines, heartBeatLines);
        }
 public IEnumerable<Result> GetHeartBeatResultsForPerformanceTest(PlanDefinition testPlan)
 {
     return GetResults(sqlForHeartBeat, testPlan);
 }
 public IEnumerable<Result> GetDailyResultsForPerformanceTest(PlanDefinition testPlan)
 {
     return GetResults(sqlForDailyResults, testPlan);
 }