public static TestRunMessages GetTestRunMessages(string testRunId)
 {
     try
     {
         return(CltHttpClientWrapper.Get <TestRunMessages>("/_apis/clt/testruns/" + testRunId + "/messages").Result);
     }
     catch (AggregateException aggregateException)
     {
         Exception innerException   = aggregateException.InnerException;
         string    exceptionMessage = "GetTestRunMessages failed with the following error";
         while (innerException != null)
         {
             exceptionMessage = exceptionMessage + "\n\t" + innerException.Message;
             innerException   = innerException.InnerException;
         }
         throw new Exception(exceptionMessage);
     }
 }
 public static GenericListStructure <TestRunCounterInstance> GetTestRunCounterInstances(string testRunId)
 {
     try
     {
         return
             (CltHttpClientWrapper.Get <GenericListStructure <TestRunCounterInstance> >("/_apis/clt/testruns/" + testRunId +
                                                                                        "/counterInstances?groupNames=Default").Result);
     }
     catch (AggregateException aggregateException)
     {
         Exception innerException   = aggregateException.InnerException;
         string    exceptionMessage = "getting test run counter instances failed with the following error";
         while (innerException != null)
         {
             exceptionMessage = exceptionMessage + "\n\t" + innerException.Message;
             innerException   = innerException.InnerException;
         }
         throw new Exception(exceptionMessage);
     }
 }
 public static IEnumerable <TestRun> GetTestRuns(string queryParam = null, string value = null)
 {
     try
     {
         if (!string.IsNullOrEmpty(queryParam) && !string.IsNullOrEmpty(value))
         {
             return(CltHttpClientWrapper.Get <IEnumerable <TestRun> >(string.Format("/_apis/clt/testruns?{0}={1}", queryParam, value)).Result);
         }
         return(CltHttpClientWrapper.Get <IEnumerable <TestRun> >("/_apis/clt/testruns").Result);
     }
     catch (AggregateException aggregateException)
     {
         Exception innerException   = aggregateException.InnerException;
         string    exceptionMessage = "GetTestRuns failed with the following error";
         while (innerException != null)
         {
             exceptionMessage = exceptionMessage + "\n\t" + innerException.Message;
             innerException   = innerException.InnerException;
         }
         throw new Exception(exceptionMessage);
     }
 }