public object Post(AddTestResults request) { var testPlanId = request.TestPlanId; var testRunId = request.TestRunId.GetValueOrDefault(); if (request.Contents.IsNullOrEmpty()) { throw new ArgumentNullException("Contents"); } var testResult = request.Contents.ToTestResult(); if (testResult.Software.IsNullOrEmpty()) { throw new ArgumentException("Invalid Apache Benchmark File", "Contents"); } var results = new[] { testResult }.ToList(); var testRun = AddTestResults(GetSignedInUserId(), testPlanId, testRunId, results); return(new AddTestResultsResponse { TestRun = testRun, Results = results, }); }
public object Post(AddTestResults request) { var testPlanId = request.TestPlanId; var testRunId = request.TestRunId.GetValueOrDefault(); if (request.Contents.IsNullOrEmpty()) throw new ArgumentNullException("Contents"); var testResult = request.Contents.ToTestResult(); if (testResult.Software.IsNullOrEmpty()) throw new ArgumentException("Invalid Apache Benchmark File", "Contents"); var results = new[] { testResult }.ToList(); var testRun = AddTestResults(GetSignedInUserId(), testPlanId, testRunId, results); return new AddTestResultsResponse { TestRun = testRun, Results = results, }; }