Skip to content
Snippets Groups Projects
Commit 79efb169 authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Fix: Remove unused IProjectQuotaApi references from ProjectReporting and ProjectReportingTests

parent 7983f1c5
No related branches found
No related tags found
1 merge request!44Update: Dependencies and removed obsolete imports
Pipeline #1679615 passed
......@@ -26,7 +26,6 @@ public class ProjectReportingTests
private IOptionsMonitor<ReportingConfiguration> _reportingConfiguration = null!;
private IAdminApi _adminApi = null!;
private IProjectQuotaApi _projectQuotaApi = null!;
private ProjectReporting _projectReporting = null!; // System Under Test
......@@ -71,7 +70,6 @@ public class ProjectReportingTests
_reportingConfiguration.CurrentValue.Returns(reportingConfig);
_adminApi = Substitute.For<IAdminApi>();
_projectQuotaApi = Substitute.For<ProjectQuotaApi>();
}
#region GenerateReportingAsync Tests
......@@ -96,7 +94,7 @@ public class ProjectReportingTests
var pagination = new Pagination(currentPage: 1, pageSize: 2, totalCount: 2, totalPages: 1);
return Task.FromResult(new ProjectAdminDtoPagedResponse(data: projects, pagination: pagination, statusCode: 200, traceId: "dummy-trace-id"));
});
_projectReporting = new ProjectReporting(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi, _projectQuotaApi);
_projectReporting = new ProjectReporting(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi);
// Act
var result = await _projectReporting.GenerateReportingAsync();
......@@ -128,7 +126,7 @@ public class ProjectReportingTests
var pagination = new Pagination(currentPage: 1, pageSize: 0, totalCount: 0, totalPages: 1);
return Task.FromResult(new ProjectAdminDtoPagedResponse(data: [], pagination: pagination, statusCode: 200, traceId: "dummy-trace-id"));
});
_projectReporting = new ProjectReporting(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi, _projectQuotaApi);
_projectReporting = new ProjectReporting(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi);
// Act
var result = await _projectReporting.GenerateReportingAsync();
......@@ -155,7 +153,7 @@ public class ProjectReportingTests
};
// We want to ensure that GenerateReportingAsync returns some test objects
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi, _projectQuotaApi);
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi);
_projectReporting
.Configure()
.GenerateReportingAsync()
......@@ -195,7 +193,7 @@ public class ProjectReportingTests
};
// Partial mock to override GenerateReportingAsync
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi, _projectQuotaApi);
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi);
_projectReporting
.Configure()
.GenerateReportingAsync()
......@@ -235,7 +233,7 @@ public class ProjectReportingTests
};
// Partial mock to override GenerateReportingAsync
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi, _projectQuotaApi);
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi);
_projectReporting
.Configure()
.GenerateReportingAsync()
......@@ -272,7 +270,7 @@ public class ProjectReportingTests
};
// Partial mock
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi, _projectQuotaApi);
_projectReporting = Substitute.ForPartsOf<ProjectReporting>(_mapper, _logger, _gitlabStorageService, _localStorageService, _kpiConfiguration, _reportingConfiguration, _adminApi);
_projectReporting
.Configure()
.GenerateReportingAsync()
......
......@@ -22,7 +22,6 @@ public class ProjectReporting
private readonly KpiConfiguration _kpiConfiguration;
private readonly ReportingConfiguration _reportingConfiguration;
private readonly IAdminApi _adminApi;
private readonly IProjectQuotaApi _projectQuotaApi;
public ProjectReportingOptions Options { get; private set; } = null!;
public string ReportingFileName { get; }
......@@ -34,8 +33,7 @@ public class ProjectReporting
[FromKeyedServices("local")] IStorageService localStorageService,
IOptionsMonitor<KpiConfiguration> kpiConfiguration,
IOptionsMonitor<ReportingConfiguration> reportingConfiguration,
IAdminApi adminApi,
IProjectQuotaApi projectQuotaApi
IAdminApi adminApi
)
{
_mapper = mapper;
......@@ -47,7 +45,6 @@ public class ProjectReporting
ReportingFileName = _kpiConfiguration.ProjectKpi.FileName;
_adminApi = adminApi;
_projectQuotaApi = projectQuotaApi;
}
public async Task<bool> RunAsync(ProjectReportingOptions reportingOptions)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment