< Summary

Information
Class: ReportingServices.UI.Controllers.PlanningReportController
Assembly: ReportingServices.UI
File(s): C:\Users\wathen\source\repos\ReportingServices\ReportingServices.UI\Controllers\PlanningReportController.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 18
Coverable lines: 18
Total lines: 35
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Method coverage is only available for sponsors.

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor()100%10%
Index()100%10%
WeeklyPartChangesReport()100%10%

File(s)

C:\Users\wathen\source\repos\ReportingServices\ReportingServices.UI\Controllers\PlanningReportController.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Mvc;
 2using ReportingServices.Shared.Models.PlanningReport;
 3using ReportingServices.Shared.HelperClasses;
 4
 5namespace ReportingServices.UI.Controllers
 6{
 7    public class PlanningReportController : Controller
 8    {
 09        private readonly string _baseUrl = "https://localhost:7196/api/ScrapeDB/";
 10
 11        public IActionResult Index()
 012        {
 013            return View();
 014        }
 15
 16        public async Task<IActionResult> WeeklyPartChangesReport(DateTime startDate, DateTime endDate)
 017        {
 018            string partChangeUrl = _baseUrl + "PartChanges?startDate=" + startDate.ToString() + "&endDate=" + endDate.To
 019            string psnwoRunsUrl = _baseUrl + "PSNWO?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString(
 20
 021            int numberOfPartChanges = await ApiCaller.GetApi<int>(partChangeUrl);
 022            List<ReactorPSNWORuns> reactorPSNWORuns = await ApiCaller.GetApi<List<ReactorPSNWORuns>>(psnwoRunsUrl);
 23
 024            WeeklyPartChanges weeklyPartChanges = new()
 025            {
 026                TotalPartChanges = numberOfPartChanges,
 027                StartDate = startDate.ToShortDateString(),
 028                EndDate = endDate.ToShortDateString(),
 029                ReactorPSNWORuns = reactorPSNWORuns
 030            };
 31
 032            return View(weeklyPartChanges);
 033        }
 34    }
 35}