示例#1
0
    public ActionResult ShowBuilds(CodeCoverageModel codeCoverageModel)
    {
      // codeCoverageModel.SelectedBranch = projectConfiguration;
      codeCoverageModel.BuildsCollection = 
        _teamCityClient
        .Projects.BuildTypes.Builds
        .GetBuildsCollection(codeCoverageModel.ProjectName, codeCoverageModel.SelectedBranch.Name, BuildStatus.SUCCESS, null, 2, 1);

      return View("Statistics", codeCoverageModel);
    }
示例#2
0
    public ActionResult ProjectParameters(string projectId)
    {
      ProjectDetails projectDetails = _teamCityClient.Projects.GetProjectDetailsById(projectId);

      var codeCoverageModel = new CodeCoverageModel()
      {
        ProjectName = projectDetails.Name,
        Branches = projectDetails.ConfigurationsList,
        Before = string.Empty,
        After = string.Empty
      };

      return View("Statistics", codeCoverageModel);
    }
示例#3
0
    public ActionResult ShowStatistics(CodeCoverageModel codeCoverageModel)
    {
      var statisticsBefore = _teamCityClient.Projects.BuildTypes.Builds.GetBuildStatisticsById(codeCoverageModel.SelectedBuildBeforeId);
      var statisticsAfter = _teamCityClient.Projects.BuildTypes.Builds.GetBuildStatisticsById(codeCoverageModel.SelectedBuildAfterId);
      
      if (statisticsBefore != null)
      {
        codeCoverageModel.Before = statisticsBefore.Property.Where(x => x.Name == "CodeCoverageS").Select(y => y.Value).FirstOrDefault();
      }

      if (statisticsAfter != null)
      {
        codeCoverageModel.After = statisticsAfter.Property.Where(x => x.Name == "CodeCoverageS").Select(y => y.Value).FirstOrDefault();
      }

      return View("Statistics", codeCoverageModel);
    }