Skip to content

Commit

Permalink
fix broken unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
cofaulco committed Jan 22, 2021
1 parent 55644d4 commit 33c5e20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SFA.DAS.EmployerFinance/Services/PaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@ public async Task<ICollection<PaymentDetails>> GetAccountPayments(string periodE
details.PeriodEnd = periodEnd;
var getCourseDetailsTask = GetCourseDetails(details);

var provider = providerDetails[details.Ukprn];
providerDetails.TryGetValue(details.Ukprn, out var provider);
details.ProviderName = provider?.Name;
details.IsHistoricProviderName = provider?.IsHistoricProviderName ?? false;

var apprenticeship = apprenticeshipDetails[details.ApprenticeshipId];

if (apprenticeship != null)
if (apprenticeshipDetails.TryGetValue(details.ApprenticeshipId, out var apprenticeship))
{
details.ApprenticeName = $"{apprenticeship.FirstName} {apprenticeship.LastName}";
details.ApprenticeNINumber = apprenticeship.NINumber;
Expand Down Expand Up @@ -134,7 +132,9 @@ private async Task<Dictionary<long, Apprenticeship>> GetApprenticeshipDetailsDic
//}

var apprenticeships = await Task.WhenAll(taskList);
resultApprenticeships = apprenticeships.ToDictionary(app => app.Id, app => app);
resultApprenticeships = apprenticeships
.Where(app => app != null)
.ToDictionary(app => app.Id, app => app);

return resultApprenticeships;
}
Expand Down

0 comments on commit 33c5e20

Please sign in to comment.