From fbaf0f0e65c8953900c7bff66f34825210df436c Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 09:39:32 +0100 Subject: [PATCH 01/22] remove unnecessary using --- .../Orchestrators/ProviderOrchestrator.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SFA.DAS.Commitments.Api/Orchestrators/ProviderOrchestrator.cs b/src/SFA.DAS.Commitments.Api/Orchestrators/ProviderOrchestrator.cs index cdee8dbad2..ea1e75b646 100644 --- a/src/SFA.DAS.Commitments.Api/Orchestrators/ProviderOrchestrator.cs +++ b/src/SFA.DAS.Commitments.Api/Orchestrators/ProviderOrchestrator.cs @@ -39,7 +39,6 @@ using SFA.DAS.Commitments.Domain.Entities; using Apprenticeship = SFA.DAS.Commitments.Api.Types.Apprenticeship.Apprenticeship; -using OrganisationType = SFA.DAS.Commitments.Api.Types.OrganisationType; using Relationship = SFA.DAS.Commitments.Domain.Entities.Relationship; namespace SFA.DAS.Commitments.Api.Orchestrators From 286d54cdc972a4f7e231c61bbf234b640d9ea0f1 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 10:39:14 +0100 Subject: [PATCH 02/22] update SFA.DAS.Apprenticeships.Api.Client.[Client|Types] (which brings in package version of System.Net.Http) --- .../app.config | 4 +++ .../App.config | 4 +++ .../app.config | 4 +++ .../App.config | 4 +++ ...aToApprenticeships.WebJob.UnitTests.csproj | 4 +-- .../app.config | 4 +++ .../packages.config | 2 +- .../App.config | 4 +++ ...ents.AddEpaToApprenticeships.WebJob.csproj | 4 +-- .../packages.config | 2 +- .../app.config | 4 +++ .../app.config | 4 +++ src/SFA.DAS.Commitments.Api/Web.config | 4 +++ .../app.config | 4 +++ .../SFA.DAS.Commitments.Domain.csproj | 4 +-- .../packages.config | 4 +-- ...ommitments.Infrastructure.UnitTests.csproj | 4 +-- .../app.config | 4 +++ .../packages.config | 2 +- .../SFA.DAS.Commitments.Infrastructure.csproj | 25 ++++++++++++++----- .../ApprenticeshipInfoServiceWrapper.cs | 3 +++ .../app.config | 4 +++ .../packages.config | 9 +++++-- .../App.config | 4 +++ .../App.config | 4 +++ 25 files changed, 98 insertions(+), 21 deletions(-) diff --git a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config index 8301c2fcdc..777d722d2b 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config +++ b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config @@ -50,6 +50,10 @@ + + + + diff --git a/src/SFA.DAS.CommitmentPayments.WebJob/App.config b/src/SFA.DAS.CommitmentPayments.WebJob/App.config index e797f3a3e1..f57c7bea41 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob/App.config +++ b/src/SFA.DAS.CommitmentPayments.WebJob/App.config @@ -78,6 +78,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config index 171b837dbd..9f663f8de0 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config @@ -54,6 +54,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config index 9448ffd81d..3443ed8cf7 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config @@ -78,6 +78,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj index 1fb781d55e..c9fc87bf36 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj @@ -60,8 +60,8 @@ ..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll - - ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.10.122\lib\net45\SFA.DAS.Apprenticeships.Api.Types.dll + + ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config index dfca790cff..e696926afb 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config @@ -54,6 +54,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config index 66c1deb47b..5999d21137 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config @@ -9,7 +9,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config index c96d76fdeb..4876814b9a 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config @@ -82,6 +82,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj index 972b78dc0a..31d57b9d90 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj @@ -77,8 +77,8 @@ ..\packages\Polly.5.7.0\lib\net45\Polly.dll - - ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.10.122\lib\net45\SFA.DAS.Apprenticeships.Api.Types.dll + + ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config index 7e13c737cc..e9fccede6c 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config @@ -20,7 +20,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config b/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config index 32f5b9cffc..a4e1fe2378 100644 --- a/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config +++ b/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config @@ -74,6 +74,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.Api.UnitTests/app.config b/src/SFA.DAS.Commitments.Api.UnitTests/app.config index 898f74e475..22008ae4a8 100644 --- a/src/SFA.DAS.Commitments.Api.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Api.UnitTests/app.config @@ -74,6 +74,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.Api/Web.config b/src/SFA.DAS.Commitments.Api/Web.config index 58896fb61e..a8b4286b34 100644 --- a/src/SFA.DAS.Commitments.Api/Web.config +++ b/src/SFA.DAS.Commitments.Api/Web.config @@ -171,6 +171,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.Application.UnitTests/app.config b/src/SFA.DAS.Commitments.Application.UnitTests/app.config index f2c4f69b8a..2d6b793b1b 100644 --- a/src/SFA.DAS.Commitments.Application.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Application.UnitTests/app.config @@ -70,6 +70,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj index e5b3d57bca..c8ae5cf83a 100644 --- a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj +++ b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj @@ -47,8 +47,8 @@ ..\packages\NLog.4.3.7\lib\net45\NLog.dll - - ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.10.122\lib\net45\SFA.DAS.Apprenticeships.Api.Types.dll + + ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll diff --git a/src/SFA.DAS.Commitments.Domain/packages.config b/src/SFA.DAS.Commitments.Domain/packages.config index 93ad4f520a..2556411cf0 100644 --- a/src/SFA.DAS.Commitments.Domain/packages.config +++ b/src/SFA.DAS.Commitments.Domain/packages.config @@ -5,7 +5,7 @@ - + @@ -13,4 +13,4 @@ - + \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj index dc84896e2b..eebaff3249 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj @@ -67,8 +67,8 @@ ..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll - - ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.10.122\lib\net45\SFA.DAS.Apprenticeships.Api.Types.dll + + ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config index f94f996ada..70b6394d70 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config @@ -42,6 +42,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config index be751e9220..ffd0aa59c1 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config @@ -10,7 +10,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj index 875ace448b..762909f140 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj @@ -84,12 +84,11 @@ ..\packages\Polly.5.7.0\lib\net45\Polly.dll - - ..\packages\SFA.DAS.Apprenticeships.Api.Client.0.10.95\lib\net45\SFA.DAS.Apprenticeships.Api.Client.dll - True + + ..\packages\SFA.DAS.Apprenticeships.Api.Client.0.11.75\lib\net462\SFA.DAS.Apprenticeships.Api.Client.dll - - ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.10.122\lib\net45\SFA.DAS.Apprenticeships.Api.Types.dll + + ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll @@ -151,10 +150,25 @@ + + ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + ..\packages\System.Spatial.5.7.0\lib\net40\System.Spatial.dll @@ -168,7 +182,6 @@ - diff --git a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceWrapper.cs b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceWrapper.cs index 7c62a6af30..5c2a5f3270 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceWrapper.cs +++ b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceWrapper.cs @@ -70,6 +70,8 @@ public async Task GetTrainingProgramAsync(string id, bool re return programmes.FirstOrDefault(m => m.Id == id); } + // temporarily disable warning whilst we determine what breaks the deployment +#pragma warning disable CS0618 private static FrameworksView MapFrom(List frameworks) { return new FrameworksView @@ -108,6 +110,7 @@ private static StandardsView MapFrom(List standards) }).ToList() }; } +#pragma warning restore CS0618 private static string GetTitle(string title, int level) { diff --git a/src/SFA.DAS.Commitments.Infrastructure/app.config b/src/SFA.DAS.Commitments.Infrastructure/app.config index 3282f195d4..1f038860d6 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/app.config +++ b/src/SFA.DAS.Commitments.Infrastructure/app.config @@ -42,6 +42,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.Infrastructure/packages.config b/src/SFA.DAS.Commitments.Infrastructure/packages.config index 795890d421..d4b606d5f4 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/packages.config +++ b/src/SFA.DAS.Commitments.Infrastructure/packages.config @@ -13,8 +13,8 @@ - - + + @@ -32,6 +32,11 @@ + + + + + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config index 0b61a1d714..efc23884a9 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config @@ -57,6 +57,10 @@ + + + + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/App.config b/src/SFA.DAS.Commitments.Notification.WebJob/App.config index ef9c02adb1..ab488f6f62 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/App.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob/App.config @@ -78,6 +78,10 @@ + + + + From d5cc7b990eca72cd470582704bf5a826e65273a7 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 11:06:14 +0100 Subject: [PATCH 03/22] remove all references to .net framework version of System.Net.Http and add/reinstall package reference where necessary + package manager reverted SFA.DAS.EAS.Account.Api.Client of its own accord, so updated back to original version --- ...CommitmentPayments.WebJob.UnitTests.csproj | 1 - .../SFA.DAS.CommitmentPayments.WebJob.csproj | 1 - ....AcademicYearEndProcessor.UnitTests.csproj | 1 - ...nts.AcademicYearEndProcessor.WebJob.csproj | 1 - ...aToApprenticeships.WebJob.UnitTests.csproj | 1 - ...ents.AddEpaToApprenticeships.WebJob.csproj | 1 - ...AS.Commitments.Api.IntegrationTests.csproj | 16 ++++++++++++++- .../packages.config | 5 +++++ ...DAS.Commitments.Api.Types.UnitTests.csproj | 1 - .../SFA.DAS.Commitments.Api.UnitTests.csproj | 1 - .../SFA.DAS.Commitments.Api.csproj | 16 ++++++++++++++- src/SFA.DAS.Commitments.Api/packages.config | 5 +++++ ...S.Commitments.Application.UnitTests.csproj | 1 - .../SFA.DAS.Commitments.Application.csproj | 1 - .../SFA.DAS.Commitments.Domain.csproj | 1 - .../SFA.DAS.Commitments.Events.csproj | 1 - ...ommitments.Infrastructure.UnitTests.csproj | 1 - ...ments.Notification.WebJob.UnitTests.csproj | 20 +++++++++++++++++-- .../packages.config | 8 ++++++-- ...DAS.Commitments.Notification.WebJob.csproj | 16 ++++++++++++++- .../packages.config | 8 ++++++-- 21 files changed, 85 insertions(+), 22 deletions(-) diff --git a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/SFA.DAS.CommitmentPayments.WebJob.UnitTests.csproj b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/SFA.DAS.CommitmentPayments.WebJob.UnitTests.csproj index abc4d9a082..6ecc96d170 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/SFA.DAS.CommitmentPayments.WebJob.UnitTests.csproj +++ b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/SFA.DAS.CommitmentPayments.WebJob.UnitTests.csproj @@ -82,7 +82,6 @@ - diff --git a/src/SFA.DAS.CommitmentPayments.WebJob/SFA.DAS.CommitmentPayments.WebJob.csproj b/src/SFA.DAS.CommitmentPayments.WebJob/SFA.DAS.CommitmentPayments.WebJob.csproj index 7dc7d26f05..9a9b82134f 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob/SFA.DAS.CommitmentPayments.WebJob.csproj +++ b/src/SFA.DAS.CommitmentPayments.WebJob/SFA.DAS.CommitmentPayments.WebJob.csproj @@ -128,7 +128,6 @@ ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests.csproj b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests.csproj index d3525c025e..4f4d02ba3c 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests.csproj @@ -100,7 +100,6 @@ - diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob.csproj b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob.csproj index 618dacd531..a7c829771f 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob.csproj +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob.csproj @@ -114,7 +114,6 @@ ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj index c9fc87bf36..3a6e32cdd0 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj @@ -80,7 +80,6 @@ - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj index 31d57b9d90..954b1b6bcd 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj @@ -116,7 +116,6 @@ ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.Api.IntegrationTests/SFA.DAS.Commitments.Api.IntegrationTests.csproj b/src/SFA.DAS.Commitments.Api.IntegrationTests/SFA.DAS.Commitments.Api.IntegrationTests.csproj index f568e1d95b..5a4638ded8 100644 --- a/src/SFA.DAS.Commitments.Api.IntegrationTests/SFA.DAS.Commitments.Api.IntegrationTests.csproj +++ b/src/SFA.DAS.Commitments.Api.IntegrationTests/SFA.DAS.Commitments.Api.IntegrationTests.csproj @@ -291,10 +291,24 @@ ..\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll - + + ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + ..\packages\System.Spatial.5.7.0\lib\net40\System.Spatial.dll diff --git a/src/SFA.DAS.Commitments.Api.IntegrationTests/packages.config b/src/SFA.DAS.Commitments.Api.IntegrationTests/packages.config index c4211c0b82..7c91671be1 100644 --- a/src/SFA.DAS.Commitments.Api.IntegrationTests/packages.config +++ b/src/SFA.DAS.Commitments.Api.IntegrationTests/packages.config @@ -36,6 +36,11 @@ + + + + + diff --git a/src/SFA.DAS.Commitments.Api.Types.UnitTests/SFA.DAS.Commitments.Api.Types.UnitTests.csproj b/src/SFA.DAS.Commitments.Api.Types.UnitTests/SFA.DAS.Commitments.Api.Types.UnitTests.csproj index 7ca8f5deac..396d3472e4 100644 --- a/src/SFA.DAS.Commitments.Api.Types.UnitTests/SFA.DAS.Commitments.Api.Types.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Api.Types.UnitTests/SFA.DAS.Commitments.Api.Types.UnitTests.csproj @@ -58,7 +58,6 @@ - diff --git a/src/SFA.DAS.Commitments.Api.UnitTests/SFA.DAS.Commitments.Api.UnitTests.csproj b/src/SFA.DAS.Commitments.Api.UnitTests/SFA.DAS.Commitments.Api.UnitTests.csproj index c5d7def22d..37c255e297 100644 --- a/src/SFA.DAS.Commitments.Api.UnitTests/SFA.DAS.Commitments.Api.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Api.UnitTests/SFA.DAS.Commitments.Api.UnitTests.csproj @@ -91,7 +91,6 @@ - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj index 6cebe45694..12498edf5f 100644 --- a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj +++ b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj @@ -224,11 +224,25 @@ True - + + ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + ..\packages\System.Spatial.5.7.0\lib\net40\System.Spatial.dll diff --git a/src/SFA.DAS.Commitments.Api/packages.config b/src/SFA.DAS.Commitments.Api/packages.config index 118a9b5fcb..e7ab716b9d 100644 --- a/src/SFA.DAS.Commitments.Api/packages.config +++ b/src/SFA.DAS.Commitments.Api/packages.config @@ -66,6 +66,11 @@ + + + + + diff --git a/src/SFA.DAS.Commitments.Application.UnitTests/SFA.DAS.Commitments.Application.UnitTests.csproj b/src/SFA.DAS.Commitments.Application.UnitTests/SFA.DAS.Commitments.Application.UnitTests.csproj index 7c48a6e5b5..381bf5f0c6 100644 --- a/src/SFA.DAS.Commitments.Application.UnitTests/SFA.DAS.Commitments.Application.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Application.UnitTests/SFA.DAS.Commitments.Application.UnitTests.csproj @@ -121,7 +121,6 @@ - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj b/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj index 36590de663..40350785cd 100644 --- a/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj +++ b/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj @@ -85,7 +85,6 @@ - diff --git a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj index c8ae5cf83a..62ba0f348e 100644 --- a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj +++ b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj @@ -76,7 +76,6 @@ - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.Events/SFA.DAS.Commitments.Events.csproj b/src/SFA.DAS.Commitments.Events/SFA.DAS.Commitments.Events.csproj index 29a7674e6b..d18122efb4 100644 --- a/src/SFA.DAS.Commitments.Events/SFA.DAS.Commitments.Events.csproj +++ b/src/SFA.DAS.Commitments.Events/SFA.DAS.Commitments.Events.csproj @@ -64,7 +64,6 @@ - diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj index eebaff3249..0c2ac2bc7d 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj @@ -98,7 +98,6 @@ ..\packages\SFA.DAS.Provider.Events.Api.Client.2.0.0.57315\lib\net45\SFA.DAS.Provider.Events.Api.Types.dll - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll diff --git a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj index 5dd7365705..434a5e7b1c 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj @@ -117,9 +117,24 @@ + + ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.6\lib\net45\System.Web.Http.dll @@ -127,7 +142,6 @@ - @@ -141,7 +155,9 @@ Designer - + + Designer + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config index bc5036a40f..463437fa65 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config @@ -13,7 +13,7 @@ - + @@ -22,5 +22,9 @@ - + + + + + \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj b/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj index b3e419dff5..b59c067e3f 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj +++ b/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj @@ -156,10 +156,24 @@ ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - + + ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.6\lib\net45\System.Net.Http.Formatting.dll + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + ..\packages\System.Spatial.5.7.0\lib\net40\System.Spatial.dll True diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/packages.config b/src/SFA.DAS.Commitments.Notification.WebJob/packages.config index 7e7bddb578..4ebdde599b 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/packages.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob/packages.config @@ -17,7 +17,7 @@ - + @@ -34,7 +34,11 @@ - + + + + + \ No newline at end of file From 93db3dbc25eedb9f9c9dde202aea92fbce8243f7 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 11:48:05 +0100 Subject: [PATCH 04/22] add temporary comment only --- .../Controllers/EmployerController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs b/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs index 0a77d688c3..5033afa55c 100644 --- a/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs +++ b/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs @@ -15,6 +15,12 @@ namespace SFA.DAS.Commitments.Api.Controllers { + // apparantly .net 4.7.1 *always* uses the framework system.net.http and ignores any package system.net.http + // https://github.com/dotnet/corefx/issues/25050 + // but cloud services doesn't support any version > 4.6.2 out of the box, so we'd have to install 4.7.1 on each server + // https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-dotnet-install-dotnet + // what a palaver! + [RoutePrefix("api/employer")] public class EmployerController : ApiController { From 6f9b090e9a733131c31f30dca41ebf35fb1bc735 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 11:50:28 +0100 Subject: [PATCH 05/22] add comment only --- src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs b/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs index 5033afa55c..f4fb59a100 100644 --- a/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs +++ b/src/SFA.DAS.Commitments.Api/Controllers/EmployerController.cs @@ -20,6 +20,9 @@ namespace SFA.DAS.Commitments.Api.Controllers // but cloud services doesn't support any version > 4.6.2 out of the box, so we'd have to install 4.7.1 on each server // https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-dotnet-install-dotnet // what a palaver! + // better to wait until we switch to app services + // https://azure.microsoft.com/en-us/updates/net-framework-4-7-2-update-coming-to-azure-app-service-apps/ + // or .net core [RoutePrefix("api/employer")] public class EmployerController : ApiController From 1c3021bac9a6adb91b36f3dedaeda13da9338735 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 12:00:34 +0100 Subject: [PATCH 06/22] try redirecting later versions of system.net.http to package version --- src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config | 2 +- src/SFA.DAS.CommitmentPayments.WebJob/App.config | 2 +- .../app.config | 2 +- .../App.config | 2 +- .../app.config | 2 +- .../App.config | 2 +- src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Api.IntegrationTests/app.config | 2 +- src/SFA.DAS.Commitments.Api.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Api/Web.config | 2 +- src/SFA.DAS.Commitments.Application.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Infrastructure/app.config | 2 +- .../App.config | 2 +- src/SFA.DAS.Commitments.Notification.WebJob/App.config | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config index 777d722d2b..69957f3123 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config +++ b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config @@ -52,7 +52,7 @@ - + diff --git a/src/SFA.DAS.CommitmentPayments.WebJob/App.config b/src/SFA.DAS.CommitmentPayments.WebJob/App.config index f57c7bea41..9be134e8e0 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob/App.config +++ b/src/SFA.DAS.CommitmentPayments.WebJob/App.config @@ -80,7 +80,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config index 9f663f8de0..e9b14f968f 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config @@ -56,7 +56,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config index 3443ed8cf7..7d9b8cb478 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config @@ -80,7 +80,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config index e696926afb..29d6643553 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config @@ -56,7 +56,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config index 4876814b9a..4d90350b31 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config @@ -84,7 +84,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config b/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config index 7ff2b0b836..c10f05bf17 100644 --- a/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config @@ -4,7 +4,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config b/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config index a4e1fe2378..6ddd50b8aa 100644 --- a/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config +++ b/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config @@ -76,7 +76,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api.UnitTests/app.config b/src/SFA.DAS.Commitments.Api.UnitTests/app.config index 22008ae4a8..15e0c109ba 100644 --- a/src/SFA.DAS.Commitments.Api.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Api.UnitTests/app.config @@ -76,7 +76,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api/Web.config b/src/SFA.DAS.Commitments.Api/Web.config index a8b4286b34..bc318e3278 100644 --- a/src/SFA.DAS.Commitments.Api/Web.config +++ b/src/SFA.DAS.Commitments.Api/Web.config @@ -173,7 +173,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Application.UnitTests/app.config b/src/SFA.DAS.Commitments.Application.UnitTests/app.config index 2d6b793b1b..4111e2bb9f 100644 --- a/src/SFA.DAS.Commitments.Application.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Application.UnitTests/app.config @@ -72,7 +72,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config index 70b6394d70..78948b8f20 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config @@ -44,7 +44,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure/app.config b/src/SFA.DAS.Commitments.Infrastructure/app.config index 1f038860d6..c07df7bca2 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/app.config +++ b/src/SFA.DAS.Commitments.Infrastructure/app.config @@ -44,7 +44,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config index efc23884a9..2d93e30194 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config @@ -59,7 +59,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/App.config b/src/SFA.DAS.Commitments.Notification.WebJob/App.config index ab488f6f62..f5221ada06 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/App.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob/App.config @@ -80,7 +80,7 @@ - + From 2b89c534f50de171173f0cf432ede35d3563a9c2 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 13:12:57 +0100 Subject: [PATCH 07/22] try different binding redirect from https://github.com/dotnet/corefx/issues/22781 --- src/SFA.DAS.Commitments.Api/Web.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFA.DAS.Commitments.Api/Web.config b/src/SFA.DAS.Commitments.Api/Web.config index bc318e3278..6a86362983 100644 --- a/src/SFA.DAS.Commitments.Api/Web.config +++ b/src/SFA.DAS.Commitments.Api/Web.config @@ -173,7 +173,7 @@ - + From da0dd8916e6e4fafb103a3a9abf8cffc7856e301 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 13:27:19 +0100 Subject: [PATCH 08/22] try and add a binding redirect for the web role for system.net.http see https://github.com/dotnet/corefx/issues/22781#issuecomment-322694600 https://blogs.msdn.microsoft.com/friis/2014/05/15/webrole-entry-point-and-config-file/ https://azure.microsoft.com/en-us/blog/new-full-iis-capabilities-differences-from-hosted-web-core/ --- .../SFA.DAS.Commitments.Api.csproj | 3 +++ .../WaIISHost.exe.config | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/SFA.DAS.Commitments.Api/WaIISHost.exe.config diff --git a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj index 12498edf5f..69abf56de0 100644 --- a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj +++ b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj @@ -356,6 +356,9 @@ Designer + + Always + Web.config diff --git a/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config b/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config new file mode 100644 index 0000000000..080bdcfd3b --- /dev/null +++ b/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + From bfbc33a6fa894cecc4b5d85b39f0eb20a1aa2a0b Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 13:49:21 +0100 Subject: [PATCH 09/22] try different method of setting binding redirect, see https://blogs.msdn.microsoft.com/friis/2014/05/15/webrole-entry-point-and-config-file/ --- .../SFA.DAS.Commitments.Api.csproj | 3 +++ .../SFA.DAS.Commitments.Api.dll.config | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config diff --git a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj index 69abf56de0..d226d29f02 100644 --- a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj +++ b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj @@ -295,6 +295,9 @@ + + Always + Designer diff --git a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config new file mode 100644 index 0000000000..8b66524ba9 --- /dev/null +++ b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + From 2a2b76dae2b940013ec81ee3e9bb30568579ec10 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 14:03:44 +0100 Subject: [PATCH 10/22] specifying v4.0.0.0 of system.net.http in the redirect shows in the debug modules window that the 4.7.2 framework version is loaded! change redirects to version 4.1.1.2 (a.k.a. 4.0.0.0, 4.6.25705.01) which shows up in the modules window as the package version --- src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config | 2 +- src/SFA.DAS.Commitments.Api/WaIISHost.exe.config | 2 +- src/SFA.DAS.Commitments.Api/Web.config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config index 8b66524ba9..2dcd4dec68 100644 --- a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config +++ b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config @@ -10,7 +10,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config b/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config index 080bdcfd3b..2ec3122e48 100644 --- a/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config +++ b/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config @@ -10,7 +10,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api/Web.config b/src/SFA.DAS.Commitments.Api/Web.config index 6a86362983..0c2bf6ef97 100644 --- a/src/SFA.DAS.Commitments.Api/Web.config +++ b/src/SFA.DAS.Commitments.Api/Web.config @@ -173,7 +173,7 @@ - + From 12209d6f326ca43c574771ebb254f4347947ab91 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 14:35:45 +0100 Subject: [PATCH 11/22] it seems that the deploy/cloud service can work with the package or framework version. this should make it use the framwork version (as the package is not being updated anymore). perhaps not the best choice, but we can change it later if necessary --- src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config | 2 +- src/SFA.DAS.Commitments.Api/WaIISHost.exe.config | 2 +- src/SFA.DAS.Commitments.Api/Web.config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config index 2dcd4dec68..8b66524ba9 100644 --- a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config +++ b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.dll.config @@ -10,7 +10,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config b/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config index 2ec3122e48..080bdcfd3b 100644 --- a/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config +++ b/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config @@ -10,7 +10,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api/Web.config b/src/SFA.DAS.Commitments.Api/Web.config index 0c2bf6ef97..6a86362983 100644 --- a/src/SFA.DAS.Commitments.Api/Web.config +++ b/src/SFA.DAS.Commitments.Api/Web.config @@ -173,7 +173,7 @@ - + From ec8df0ba6ebc824626ed4a182f7af2ad323fa2cb Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 14:37:43 +0100 Subject: [PATCH 12/22] looks like the SFA.DAS.Commitments.Api.dll.config file is used, so trying removing WaIISHost.exe.config and see if it still deploys --- .../SFA.DAS.Commitments.Api.csproj | 3 --- .../WaIISHost.exe.config | 19 ------------------- 2 files changed, 22 deletions(-) delete mode 100644 src/SFA.DAS.Commitments.Api/WaIISHost.exe.config diff --git a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj index d226d29f02..06869c7e61 100644 --- a/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj +++ b/src/SFA.DAS.Commitments.Api/SFA.DAS.Commitments.Api.csproj @@ -359,9 +359,6 @@ Designer - - Always - Web.config diff --git a/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config b/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config deleted file mode 100644 index 080bdcfd3b..0000000000 --- a/src/SFA.DAS.Commitments.Api/WaIISHost.exe.config +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - From 0331473a12fcd1fad416067c55c837b13b613756 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 14:41:19 +0100 Subject: [PATCH 13/22] be consistent in all the system.net.http redirects --- src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config | 2 +- src/SFA.DAS.CommitmentPayments.WebJob/App.config | 2 +- .../app.config | 2 +- .../App.config | 2 +- .../app.config | 2 +- .../App.config | 2 +- src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Api.IntegrationTests/app.config | 2 +- src/SFA.DAS.Commitments.Api.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Application.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config | 2 +- src/SFA.DAS.Commitments.Infrastructure/app.config | 2 +- .../App.config | 2 +- src/SFA.DAS.Commitments.Notification.WebJob/App.config | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config index 69957f3123..43aa059e8f 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config +++ b/src/SFA.DAS.CommitmentPayments.WebJob.UnitTests/app.config @@ -52,7 +52,7 @@ - + diff --git a/src/SFA.DAS.CommitmentPayments.WebJob/App.config b/src/SFA.DAS.CommitmentPayments.WebJob/App.config index 9be134e8e0..1142cbdeae 100644 --- a/src/SFA.DAS.CommitmentPayments.WebJob/App.config +++ b/src/SFA.DAS.CommitmentPayments.WebJob/App.config @@ -80,7 +80,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config index e9b14f968f..08b6dc784f 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.UnitTests/app.config @@ -56,7 +56,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config index 7d9b8cb478..2ccde4d899 100644 --- a/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config +++ b/src/SFA.DAS.Commitments.AcademicYearEndProcessor.WebJob/App.config @@ -80,7 +80,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config index 29d6643553..f4a21d4c52 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/app.config @@ -56,7 +56,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config index 4d90350b31..539f7b5c9c 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/App.config @@ -84,7 +84,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config b/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config index c10f05bf17..c13e0faf80 100644 --- a/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Api.Client.UnitTests/app.config @@ -4,7 +4,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config b/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config index 6ddd50b8aa..5db3820770 100644 --- a/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config +++ b/src/SFA.DAS.Commitments.Api.IntegrationTests/app.config @@ -76,7 +76,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Api.UnitTests/app.config b/src/SFA.DAS.Commitments.Api.UnitTests/app.config index 15e0c109ba..3f1300f516 100644 --- a/src/SFA.DAS.Commitments.Api.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Api.UnitTests/app.config @@ -76,7 +76,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Application.UnitTests/app.config b/src/SFA.DAS.Commitments.Application.UnitTests/app.config index 4111e2bb9f..77c33f6896 100644 --- a/src/SFA.DAS.Commitments.Application.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Application.UnitTests/app.config @@ -72,7 +72,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config index 78948b8f20..589d19315e 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/app.config @@ -44,7 +44,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure/app.config b/src/SFA.DAS.Commitments.Infrastructure/app.config index c07df7bca2..e57d53f39d 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/app.config +++ b/src/SFA.DAS.Commitments.Infrastructure/app.config @@ -44,7 +44,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config index 2d93e30194..dece191ebf 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/App.config @@ -59,7 +59,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/App.config b/src/SFA.DAS.Commitments.Notification.WebJob/App.config index f5221ada06..2bebde15f2 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/App.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob/App.config @@ -80,7 +80,7 @@ - + From 71d39f003448f66d286d08e66a8ec395e3afe16c Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 14:58:20 +0100 Subject: [PATCH 14/22] update SFA.DAS.AssessmentOrgs.Api.Client to latest (working) version note: package manager undid the working system.net.http redirects - we're gonna have to be vigilant to stop it blatting our working config, or find a way to stop it! --- ...ommitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj | 4 ++-- .../packages.config | 2 +- .../SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj | 4 ++-- .../packages.config | 2 +- .../SFA.DAS.Commitments.Domain.csproj | 4 ++-- src/SFA.DAS.Commitments.Domain/packages.config | 2 +- .../SFA.DAS.Commitments.Infrastructure.UnitTests.csproj | 4 ++-- .../packages.config | 2 +- .../SFA.DAS.Commitments.Infrastructure.csproj | 4 ++-- src/SFA.DAS.Commitments.Infrastructure/packages.config | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj index 3a6e32cdd0..2239261f08 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests.csproj @@ -63,8 +63,8 @@ ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll - - ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll + + ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.11.75\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll ..\packages\SFA.DAS.NLog.Logger.1.0.0.43242\lib\net45\SFA.DAS.NLog.Logger.dll diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config index 5999d21137..2cdd7b6ee8 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.UnitTests/packages.config @@ -10,7 +10,7 @@ - + diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj index 954b1b6bcd..3210fdfe99 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob.csproj @@ -80,8 +80,8 @@ ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll - - ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll + + ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.11.75\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll ..\packages\SFA.DAS.Configuration.1.0.0.43116\lib\net45\SFA.DAS.Configuration.dll diff --git a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config index e9fccede6c..f6419a6b53 100644 --- a/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config +++ b/src/SFA.DAS.Commitments.AddEpaToApprenticeships.WebJob/packages.config @@ -21,7 +21,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj index 62ba0f348e..26ced96626 100644 --- a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj +++ b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj @@ -50,8 +50,8 @@ ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll - - ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll + + ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.11.75\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll ..\packages\SFA.DAS.Common.Domain.1.4.43\lib\net462\SFA.DAS.Common.Domain.dll diff --git a/src/SFA.DAS.Commitments.Domain/packages.config b/src/SFA.DAS.Commitments.Domain/packages.config index 2556411cf0..42c50c0760 100644 --- a/src/SFA.DAS.Commitments.Domain/packages.config +++ b/src/SFA.DAS.Commitments.Domain/packages.config @@ -6,7 +6,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj index 0c2ac2bc7d..97da1479ea 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj @@ -70,8 +70,8 @@ ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll - - ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll + + ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.11.75\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll ..\packages\SFA.DAS.Common.Domain.1.4.43\lib\net462\SFA.DAS.Common.Domain.dll diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config index ffd0aa59c1..ab36d1db69 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config @@ -11,7 +11,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj index 762909f140..89232fde0c 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj @@ -90,8 +90,8 @@ ..\packages\SFA.DAS.Apprenticeships.Api.Types.0.11.82\lib\net462\SFA.DAS.Apprenticeships.Api.Types.dll - - ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.10.122\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll + + ..\packages\SFA.DAS.AssessmentOrgs.Api.Client.0.11.75\lib\net45\SFA.DAS.AssessmentOrgs.Api.Client.dll ..\packages\SFA.DAS.Common.Domain.1.4.43\lib\net462\SFA.DAS.Common.Domain.dll diff --git a/src/SFA.DAS.Commitments.Infrastructure/packages.config b/src/SFA.DAS.Commitments.Infrastructure/packages.config index d4b606d5f4..be34e6239c 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/packages.config +++ b/src/SFA.DAS.Commitments.Infrastructure/packages.config @@ -15,7 +15,7 @@ - + From 26d634601994625b1dec4a27b563a6eeb5ba8e39 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 15:06:02 +0100 Subject: [PATCH 15/22] rename [I]ApprenticeshipInfoServiceWrapper -> [I]ApprenticeshipInfoService --- .../ApproveDataLockTriage/WhenApprovingDataLockTriage.cs | 4 ++-- .../ApproveDataLockTriageCommandHandler.cs | 4 ++-- ...pInfoServiceWrapper.cs => IApprenticeshipInfoService.cs} | 2 +- .../SFA.DAS.Commitments.Application.csproj | 2 +- .../SFA.DAS.Commitments.Infrastructure.csproj | 2 +- ...ipInfoServiceWrapper.cs => ApprenticeshipInfoService.cs} | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) rename src/SFA.DAS.Commitments.Application/Interfaces/{IApprenticeshipInfoServiceWrapper.cs => IApprenticeshipInfoService.cs} (88%) rename src/SFA.DAS.Commitments.Infrastructure/Services/{ApprenticeshipInfoServiceWrapper.cs => ApprenticeshipInfoService.cs} (93%) diff --git a/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs b/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs index 3941edb509..6c62dc77e7 100644 --- a/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs +++ b/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs @@ -28,7 +28,7 @@ public class WhenApprovingDataLock private Mock _dataLockRepository; private Mock _apprenticeshipRepository; private Mock _commitmentRepository; - private Mock _apprenticeshipTrainingService; + private Mock _apprenticeshipTrainingService; private ApproveDataLockTriageCommand _command; @@ -39,7 +39,7 @@ public void SetUp() _validator = new Mock>(); _dataLockRepository = new Mock(); _apprenticeshipRepository = new Mock(); - _apprenticeshipTrainingService = new Mock(); + _apprenticeshipTrainingService = new Mock(); _apprenticeshipRepository.Setup(x => x.GetApprenticeship(It.IsAny())) .ReturnsAsync(new Apprenticeship()); diff --git a/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs b/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs index cd83d5e388..28b6b3373a 100644 --- a/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs +++ b/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs @@ -25,7 +25,7 @@ public class ApproveDataLockTriageCommandHandler : AsyncRequestHandler GetStandardsAsync(bool refreshCache = false); Task GetFrameworksAsync(bool refreshCache = false); diff --git a/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj b/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj index 40350785cd..ef761d20b0 100644 --- a/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj +++ b/src/SFA.DAS.Commitments.Application/SFA.DAS.Commitments.Application.csproj @@ -175,7 +175,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj index 89232fde0c..7aeed3aa4e 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj @@ -220,7 +220,7 @@ - + diff --git a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceWrapper.cs b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs similarity index 93% rename from src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceWrapper.cs rename to src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs index 5c2a5f3270..f71a72227e 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceWrapper.cs +++ b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs @@ -14,7 +14,7 @@ namespace SFA.DAS.Commitments.Infrastructure.Services { - public class ApprenticeshipInfoServiceWrapper : IApprenticeshipInfoServiceWrapper + public class ApprenticeshipInfoService : IApprenticeshipInfoService { private const string StandardsKey = "Standards"; private const string FrameworksKey = "Frameworks"; @@ -22,7 +22,7 @@ public class ApprenticeshipInfoServiceWrapper : IApprenticeshipInfoServiceWrappe private readonly ICache _cache; private readonly IApprenticeshipInfoServiceConfiguration _config; - public ApprenticeshipInfoServiceWrapper(ICache cache, IApprenticeshipInfoServiceConfiguration config) + public ApprenticeshipInfoService(ICache cache, IApprenticeshipInfoServiceConfiguration config) { _cache = cache; _config = config; @@ -70,7 +70,7 @@ public async Task GetTrainingProgramAsync(string id, bool re return programmes.FirstOrDefault(m => m.Id == id); } - // temporarily disable warning whilst we determine what breaks the deployment + // temporarily disable warning #pragma warning disable CS0618 private static FrameworksView MapFrom(List frameworks) { From 62e5bfc82592233e0803a757943e0c5c10e692f1 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 21 Aug 2018 15:25:04 +0100 Subject: [PATCH 16/22] bring in the bulk of Chris's DPP-1000 changes --- .../ApproveDataLockTriageCommandHandler.cs | 10 --- .../Entities/TrainingProgramme/Framework.cs | 8 +- .../TrainingProgramme/FundingPeriod.cs | 11 +++ .../TrainingProgramme/ITrainingProgramme.cs | 10 ++- .../Entities/TrainingProgramme/Standard.cs | 8 +- .../IApprenticeshipInfoServiceMapper.cs | 12 +++ .../SFA.DAS.Commitments.Domain.csproj | 2 + .../SFA.DAS.Commitments.Infrastructure.csproj | 1 + .../Services/ApprenticeshipInfoService.cs | 74 +++-------------- .../ApprenticeshipInfoServiceMapper.cs | 79 +++++++++++++++++++ 10 files changed, 139 insertions(+), 76 deletions(-) create mode 100644 src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/FundingPeriod.cs create mode 100644 src/SFA.DAS.Commitments.Domain/Interfaces/IApprenticeshipInfoServiceMapper.cs create mode 100644 src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceMapper.cs diff --git a/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs b/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs index 28b6b3373a..906b9e715b 100644 --- a/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs +++ b/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs @@ -7,7 +7,6 @@ using SFA.DAS.Commitments.Application.Interfaces; using SFA.DAS.Commitments.Application.Interfaces.ApprenticeshipEvents; -using SFA.DAS.Commitments.Domain; using SFA.DAS.Commitments.Domain.Data; using SFA.DAS.Commitments.Domain.Entities; using SFA.DAS.Commitments.Domain.Entities.DataLock; @@ -39,15 +38,6 @@ public ApproveDataLockTriageCommandHandler(AbstractValidator)); - if (dataLockRepository == null) - throw new ArgumentNullException(nameof(IDataLockRepository)); - if (apprenticeshipRepository == null) - throw new ArgumentNullException(nameof(IApprenticeshipRepository)); - if (commitmentRepository == null) - throw new ArgumentNullException(nameof(ICommitmentRepository)); - _validator = validator; _dataLockRepository = dataLockRepository; _apprenticeshipRepository = apprenticeshipRepository; diff --git a/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Framework.cs b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Framework.cs index 2116f2532f..2262081b6e 100644 --- a/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Framework.cs +++ b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Framework.cs @@ -1,4 +1,7 @@ -namespace SFA.DAS.Commitments.Domain.Entities.TrainingProgramme +using System; +using System.Collections.Generic; + +namespace SFA.DAS.Commitments.Domain.Entities.TrainingProgramme { public class Framework : ITrainingProgramme { @@ -12,5 +15,8 @@ public class Framework : ITrainingProgramme public string Title { get; set; } public int Duration { get; set; } public int MaxFunding { get; set; } + public DateTime? EffectiveFrom { get; set; } + public DateTime? EffectiveTo { get; set; } + public IEnumerable FundingPeriods { get; set; } } } \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/FundingPeriod.cs b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/FundingPeriod.cs new file mode 100644 index 0000000000..518be52114 --- /dev/null +++ b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/FundingPeriod.cs @@ -0,0 +1,11 @@ +using System; + +namespace SFA.DAS.Commitments.Domain.Entities.TrainingProgramme +{ + public class FundingPeriod + { + public DateTime? EffectiveFrom { get; set; } + public DateTime? EffectiveTo { get; set; } + public int FundingCap { get; set; } + } +} \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/ITrainingProgramme.cs b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/ITrainingProgramme.cs index 8a9ffc4e13..b004db6680 100644 --- a/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/ITrainingProgramme.cs +++ b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/ITrainingProgramme.cs @@ -1,4 +1,7 @@ -namespace SFA.DAS.Commitments.Domain.Entities.TrainingProgramme +using System; +using System.Collections.Generic; + +namespace SFA.DAS.Commitments.Domain.Entities.TrainingProgramme { public interface ITrainingProgramme { @@ -6,7 +9,8 @@ public interface ITrainingProgramme string Title { get; set; } int Level { get; set; } int MaxFunding { get; set; } - - + DateTime? EffectiveFrom { get; set; } + DateTime? EffectiveTo { get; set; } + IEnumerable FundingPeriods { get; set; } } } diff --git a/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Standard.cs b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Standard.cs index cac0077f0e..6a44c47c1f 100644 --- a/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Standard.cs +++ b/src/SFA.DAS.Commitments.Domain/Entities/TrainingProgramme/Standard.cs @@ -1,4 +1,7 @@ -namespace SFA.DAS.Commitments.Domain.Entities.TrainingProgramme +using System; +using System.Collections.Generic; + +namespace SFA.DAS.Commitments.Domain.Entities.TrainingProgramme { public class Standard : ITrainingProgramme { @@ -9,5 +12,8 @@ public class Standard : ITrainingProgramme public int Level { get; set; } public int Duration { get; set; } public int MaxFunding { get; set; } + public DateTime? EffectiveFrom { get; set; } + public DateTime? EffectiveTo { get; set; } + public IEnumerable FundingPeriods { get; set; } } } \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Domain/Interfaces/IApprenticeshipInfoServiceMapper.cs b/src/SFA.DAS.Commitments.Domain/Interfaces/IApprenticeshipInfoServiceMapper.cs new file mode 100644 index 0000000000..bfde8fcc9e --- /dev/null +++ b/src/SFA.DAS.Commitments.Domain/Interfaces/IApprenticeshipInfoServiceMapper.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using SFA.DAS.Apprenticeships.Api.Types; +using SFA.DAS.Commitments.Domain.Entities.TrainingProgramme; + +namespace SFA.DAS.Commitments.Domain.Interfaces +{ + public interface IApprenticeshipInfoServiceMapper + { + FrameworksView MapFrom(List frameworks); + StandardsView MapFrom(List standards); + } +} \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj index 26ced96626..169e3f1bf8 100644 --- a/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj +++ b/src/SFA.DAS.Commitments.Domain/SFA.DAS.Commitments.Domain.csproj @@ -108,6 +108,7 @@ + @@ -154,6 +155,7 @@ + diff --git a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj index 7aeed3aa4e..e23430d694 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure/SFA.DAS.Commitments.Infrastructure.csproj @@ -221,6 +221,7 @@ + diff --git a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs index f71a72227e..2a9ddced96 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs +++ b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Linq; using System.Threading.Tasks; using SFA.DAS.Apprenticeships.Api.Client; -using SFA.DAS.Apprenticeships.Api.Types; using SFA.DAS.Commitments.Application.Interfaces; using SFA.DAS.Commitments.Domain.Entities.TrainingProgramme; using SFA.DAS.Commitments.Domain.Interfaces; -using Framework = SFA.DAS.Commitments.Domain.Entities.TrainingProgramme.Framework; -using Standard = SFA.DAS.Commitments.Domain.Entities.TrainingProgramme.Standard; - namespace SFA.DAS.Commitments.Infrastructure.Services { public class ApprenticeshipInfoService : IApprenticeshipInfoService @@ -21,22 +15,27 @@ public class ApprenticeshipInfoService : IApprenticeshipInfoService private readonly ICache _cache; private readonly IApprenticeshipInfoServiceConfiguration _config; + private readonly IApprenticeshipInfoServiceMapper _mapper; - public ApprenticeshipInfoService(ICache cache, IApprenticeshipInfoServiceConfiguration config) + public ApprenticeshipInfoService(ICache cache, + IApprenticeshipInfoServiceConfiguration config, + IApprenticeshipInfoServiceMapper mapper) { _cache = cache; _config = config; + _mapper = mapper; } - public async Task GetStandardsAsync(bool refreshCache = false) + //todo: private helper for common code? + public async Task GetStandardsAsync(bool refreshCache = false) { if (!await _cache.ExistsAsync(StandardsKey) || refreshCache) { var api = new StandardApiClient(_config.BaseUrl); - var standards = api.FindAll().OrderBy(x => x.Title).ToList(); + var standards = (await api.GetAllAsync()).OrderBy(x => x.Title).ToList(); - await _cache.SetCustomValueAsync(StandardsKey, MapFrom(standards)); + await _cache.SetCustomValueAsync(StandardsKey, _mapper.MapFrom(standards)); } return await _cache.GetCustomValueAsync(StandardsKey); @@ -48,9 +47,9 @@ public async Task GetFrameworksAsync(bool refreshCache = false) { var api = new FrameworkApiClient(_config.BaseUrl); - var frameworks = api.FindAll().OrderBy(x => x.Title).ToList(); + var frameworks = (await api.GetAllAsync()).OrderBy(x => x.Title).ToList(); - await _cache.SetCustomValueAsync(FrameworksKey, MapFrom(frameworks)); + await _cache.SetCustomValueAsync(FrameworksKey, _mapper.MapFrom(frameworks)); } return await _cache.GetCustomValueAsync(FrameworksKey); @@ -69,52 +68,5 @@ public async Task GetTrainingProgramAsync(string id, bool re return programmes.FirstOrDefault(m => m.Id == id); } - - // temporarily disable warning -#pragma warning disable CS0618 - private static FrameworksView MapFrom(List frameworks) - { - return new FrameworksView - { - CreatedDate = DateTime.UtcNow, - Frameworks = frameworks.Select(x => new Framework - { - Id = x.Id, - Title = GetTitle(x.FrameworkName.Trim() == x.PathwayName.Trim() ? x.FrameworkName : x.Title, x.Level), - FrameworkCode = x.FrameworkCode, - FrameworkName = x.FrameworkName, - ProgrammeType = x.ProgType, - Level = x.Level, - PathwayCode = x.PathwayCode, - PathwayName = x.PathwayName, - Duration = x.Duration, - MaxFunding = x.MaxFunding - }).ToList() - }; - } - - private static StandardsView MapFrom(List standards) - { - return new StandardsView - { - CreationDate = DateTime.UtcNow, - Standards = standards.Select(x => new Standard - { - Id = x.Id, - Code = long.Parse(x.Id), - Level = x.Level, - Title = GetTitle(x.Title, x.Level) + " (Standard)", - CourseName = x.Title, - Duration = x.Duration, - MaxFunding = x.MaxFunding - }).ToList() - }; - } -#pragma warning restore CS0618 - - private static string GetTitle(string title, int level) - { - return $"{title}, Level: {level}"; - } } -} +} \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceMapper.cs b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceMapper.cs new file mode 100644 index 0000000000..3913028b92 --- /dev/null +++ b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoServiceMapper.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SFA.DAS.Apprenticeships.Api.Types; +using SFA.DAS.Commitments.Domain.Entities.TrainingProgramme; +using SFA.DAS.Commitments.Domain.Interfaces; +using Framework = SFA.DAS.Commitments.Domain.Entities.TrainingProgramme.Framework; +using Standard = SFA.DAS.Commitments.Domain.Entities.TrainingProgramme.Standard; +using FundingPeriod = SFA.DAS.Commitments.Domain.Entities.TrainingProgramme.FundingPeriod; + +namespace SFA.DAS.Commitments.Infrastructure.Services +{ + public class ApprenticeshipInfoServiceMapper : IApprenticeshipInfoServiceMapper + { + public FrameworksView MapFrom(List frameworks) + { + return new FrameworksView + { + CreatedDate = DateTime.UtcNow, + Frameworks = frameworks.Select(x => new Framework + { + Id = x.Id, + Title = GetTitle(x.FrameworkName.Trim() == x.PathwayName.Trim() ? x.FrameworkName : x.Title, x.Level), + FrameworkCode = x.FrameworkCode, + FrameworkName = x.FrameworkName, + ProgrammeType = x.ProgType, + Level = x.Level, + PathwayCode = x.PathwayCode, + PathwayName = x.PathwayName, + Duration = x.Duration, + MaxFunding = x.CurrentFundingCap, + EffectiveFrom = x.EffectiveFrom, + EffectiveTo = x.EffectiveTo, + FundingPeriods = MapFundingPeriods(x.FundingPeriods) + }).ToList() + }; + } + + public StandardsView MapFrom(List standards) + { + return new StandardsView + { + CreationDate = DateTime.UtcNow, + Standards = standards.Select(x => new Standard + { + Id = x.Id, + Code = long.Parse(x.Id), + Level = x.Level, + Title = GetTitle(x.Title, x.Level) + " (Standard)", + CourseName = x.Title, + Duration = x.Duration, + MaxFunding = x.CurrentFundingCap, + EffectiveFrom = x.EffectiveFrom, + EffectiveTo = x.LastDateForNewStarts, + FundingPeriods = MapFundingPeriods(x.FundingPeriods) + }).ToList() + }; + } + private static IEnumerable MapFundingPeriods(IEnumerable source) + { + if (source == null) + { + return Enumerable.Empty(); + } + + return source.Select(x => new FundingPeriod + { + EffectiveFrom = x.EffectiveFrom, + EffectiveTo = x.EffectiveTo, + FundingCap = x.FundingCap + }); + } + + private static string GetTitle(string title, int level) + { + return $"{title}, Level: {level}"; + } + } +} \ No newline at end of file From 04d2c988546bc98a599ecf6bd526d59831283227 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Wed, 22 Aug 2018 07:56:32 +0100 Subject: [PATCH 17/22] update SFA.DAS.Account.Api.[Client|Types] (these were updated in DPP-1000, but not sure if they need to be updated) --- .../SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj | 4 ++-- .../packages.config | 4 ++-- .../SFA.DAS.Commitments.Notification.WebJob.csproj | 4 ++-- src/SFA.DAS.Commitments.Notification.WebJob/packages.config | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj index 434a5e7b1c..37d45bd4c3 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/SFA.DAS.Commitments.Notification.WebJob.UnitTests.csproj @@ -84,10 +84,10 @@ ..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll - ..\packages\SFA.DAS.Account.Api.Client.1.3.510\lib\net45\SFA.DAS.EAS.Account.Api.Client.dll + ..\packages\SFA.DAS.Account.Api.Client.1.3.944\lib\net45\SFA.DAS.EAS.Account.Api.Client.dll - ..\packages\SFA.DAS.Account.Api.Types.1.3.510\lib\net45\SFA.DAS.EAS.Account.Api.Types.dll + ..\packages\SFA.DAS.Account.Api.Types.1.3.944\lib\net45\SFA.DAS.EAS.Account.Api.Types.dll ..\packages\SFA.DAS.Http.1.2.4\lib\net45\SFA.DAS.Http.dll diff --git a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config index 463437fa65..6bd36fd06e 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob.UnitTests/packages.config @@ -13,8 +13,8 @@ - - + + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj b/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj index b59c067e3f..8ad9573240 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj +++ b/src/SFA.DAS.Commitments.Notification.WebJob/SFA.DAS.Commitments.Notification.WebJob.csproj @@ -107,10 +107,10 @@ True - ..\packages\SFA.DAS.Account.Api.Client.1.3.510\lib\net45\SFA.DAS.EAS.Account.Api.Client.dll + ..\packages\SFA.DAS.Account.Api.Client.1.3.944\lib\net45\SFA.DAS.EAS.Account.Api.Client.dll - ..\packages\SFA.DAS.Account.Api.Types.1.3.510\lib\net45\SFA.DAS.EAS.Account.Api.Types.dll + ..\packages\SFA.DAS.Account.Api.Types.1.3.944\lib\net45\SFA.DAS.EAS.Account.Api.Types.dll ..\packages\SFA.DAS.Http.1.2.4\lib\net45\SFA.DAS.Http.dll diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/packages.config b/src/SFA.DAS.Commitments.Notification.WebJob/packages.config index 4ebdde599b..f0bf3f4459 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/packages.config +++ b/src/SFA.DAS.Commitments.Notification.WebJob/packages.config @@ -17,8 +17,8 @@ - - + + From 0b4cd126aa5c9880a12a3c4945cc79842fd7bc44 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Wed, 22 Aug 2018 08:23:40 +0100 Subject: [PATCH 18/22] add unit tests from Chris's DPP-1000 branch --- ...ommitments.Infrastructure.UnitTests.csproj | 5 + .../WhenIMapAFramework.cs | 107 ++++++++++++++++++ .../WhenIMapAStandard.cs | 103 +++++++++++++++++ .../packages.config | 1 + .../FakeAccountApiClient.cs | 10 ++ 5 files changed, 226 insertions(+) create mode 100644 src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs create mode 100644 src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj index 97da1479ea..f80aaeb07a 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj @@ -48,6 +48,9 @@ ..\packages\FluentAssertions.4.19.2\lib\net45\FluentAssertions.Core.dll + + ..\packages\CompareNETObjects.4.55.0.0\lib\net46\KellermanSoftware.Compare-NET-Objects.dll + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.18.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll @@ -120,6 +123,8 @@ + + diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs new file mode 100644 index 0000000000..d329d6e52e --- /dev/null +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using KellermanSoftware.CompareNetObjects; +using Newtonsoft.Json; +using NUnit.Framework; +using SFA.DAS.Apprenticeships.Api.Types; +using SFA.DAS.Commitments.Infrastructure.Services; + +namespace SFA.DAS.Commitments.Infrastructure.UnitTests.Services.ApprenticeshipInfoServiceMapperTests +{ + [TestFixture] + public class WhenIMapFramework + { + private ApprenticeshipInfoServiceMapper _mapper; + private FrameworkSummary _framework; + + [SetUp] + public void Arrange() + { + _mapper = new ApprenticeshipInfoServiceMapper(); + + _framework = new FrameworkSummary + { + Id = "1", + Title = "TestTitle", + FrameworkName = "TestFrameworkName", + PathwayName = "TestPathwayName", + Level = 1, + CurrentFundingCap = 1000, //this is to become redundant + EffectiveFrom = new DateTime(2017, 05, 01), + EffectiveTo = new DateTime(2020, 7, 31), + FundingPeriods = new List + { + new FundingPeriod { EffectiveFrom = new DateTime(2017,05,01), EffectiveTo = new DateTime(2018, 12, 31), FundingCap = 5000 }, + new FundingPeriod { EffectiveFrom = new DateTime(2019,01,01), EffectiveTo = new DateTime(2020, 7, 31), FundingCap = 2000 } + } + }; + } + + [Test] + public void ThenTitleIsMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + + //Assert + var expectedTitle = $"{_framework.Title}, Level: {_framework.Level}"; + Assert.AreEqual(expectedTitle, result.Frameworks[0].Title); + } + + [Test] + public void ThenEffectiveFromIsMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + + //Assert + Assert.AreEqual(_framework.EffectiveFrom, result.Frameworks[0].EffectiveFrom); + } + + [Test] + public void ThenEffectiveToIsMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + + //Assert + Assert.AreEqual(_framework.EffectiveFrom, result.Frameworks[0].EffectiveFrom); + } + + + [Test] + public void ThenFundingPeriodsAreMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + + //Assert + var comparer = new CompareLogic(new ComparisonConfig + { + IgnoreObjectTypes = true + }); + + Assert.IsTrue(comparer.Compare(result.Frameworks[0].FundingPeriods, _framework.FundingPeriods).AreEqual); + } + + [Test] + public void ThenFundingPeriodsAreMappedCorrectlyWhenNull() + { + //Arrange + _framework.FundingPeriods = null; + + //Act + var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + + //Assert + Assert.IsNotNull(result.Frameworks[0].FundingPeriods); + Assert.IsEmpty(result.Frameworks[0].FundingPeriods); + } + + private static FrameworkSummary CopyOf(FrameworkSummary source) + { + //copy the payload to guard against handler modifications + return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source)); + } + } +} \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs new file mode 100644 index 0000000000..a257e72aa9 --- /dev/null +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using KellermanSoftware.CompareNetObjects; +using Newtonsoft.Json; +using NUnit.Framework; +using SFA.DAS.Apprenticeships.Api.Types; +using SFA.DAS.Commitments.Infrastructure.Services; + +namespace SFA.DAS.Commitments.Infrastructure.UnitTests.Services.ApprenticeshipInfoServiceMapperTests +{ + [TestFixture] + public class WhenIMapStandard + { + private ApprenticeshipInfoServiceMapper _mapper; + private StandardSummary _standard; + + [SetUp] + public void Arrange() + { + _mapper = new ApprenticeshipInfoServiceMapper(); + + _standard = new StandardSummary + { + Id = "1", + Title = "TestTitle", + Level = 1, + CurrentFundingCap = 1000, //this is to become redundant + EffectiveFrom = new DateTime(2017, 05, 01), + LastDateForNewStarts = new DateTime(2020, 7, 31), + FundingPeriods = new List + { + new FundingPeriod { EffectiveFrom = new DateTime(2017,05,01), EffectiveTo = new DateTime(2018, 12, 31), FundingCap = 5000 }, + new FundingPeriod { EffectiveFrom = new DateTime(2019,01,01), EffectiveTo = new DateTime(2020, 7, 31), FundingCap = 2000 } + } + }; + } + + [Test] + public void ThenTitleIsMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + + //Assert + var expectedTitle = $"{_standard.Title}, Level: {_standard.Level} (Standard)"; + Assert.AreEqual(expectedTitle, result.Standards[0].Title); + } + + [Test] + public void ThenEffectiveFromIsMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + + //Assert + Assert.AreEqual(_standard.EffectiveFrom, result.Standards[0].EffectiveFrom); + } + + [Test] + public void ThenEffectiveToIsMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + + //Assert + Assert.AreEqual(_standard.LastDateForNewStarts, result.Standards[0].EffectiveTo); + } + + [Test] + public void ThenFundingPeriodsAreMappedCorrectly() + { + //Act + var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + + var comparer = new CompareLogic(new ComparisonConfig + { + IgnoreObjectTypes = true + }); + + Assert.IsTrue(comparer.Compare(result.Standards[0].FundingPeriods, _standard.FundingPeriods).AreEqual); + } + + [Test] + public void ThenFundingPeriodsAreMappedCorrectlyWhenNull() + { + //Arrange + _standard.FundingPeriods = null; + + //Act + var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + + //Assert + Assert.IsNotNull(result.Standards[0].FundingPeriods); + Assert.IsEmpty(result.Standards[0].FundingPeriods); + } + + private static StandardSummary CopyOf(StandardSummary source) + { + //copy the payload to guard against handler modifications + return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source)); + } + } +} \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config index ab36d1db69..0e2b29bbbb 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/packages.config @@ -1,6 +1,7 @@  + diff --git a/src/SFA.DAS.Commitments.Notification.WebJob/DependencyResolution/FakeAccountApiClient.cs b/src/SFA.DAS.Commitments.Notification.WebJob/DependencyResolution/FakeAccountApiClient.cs index 6e645453dd..b5ad630ec0 100644 --- a/src/SFA.DAS.Commitments.Notification.WebJob/DependencyResolution/FakeAccountApiClient.cs +++ b/src/SFA.DAS.Commitments.Notification.WebJob/DependencyResolution/FakeAccountApiClient.cs @@ -15,6 +15,11 @@ public Task GetResource(string uri) where T : SFA.DAS.EAS.Account.Api.Type throw new NotImplementedException(); } + public Task GetStatistics() + { + throw new NotImplementedException(); + } + public Task GetTransactions(string accountId, int year, int month) { throw new NotImplementedException(); @@ -35,6 +40,11 @@ public Task> GetLevyDeclarations(string ac throw new NotImplementedException(); } + public Task> GetPageOfAccountLegalEntities(int pageNumber = 1, int pageSize = 1000) + { + throw new NotImplementedException(); + } + Task> IAccountApiClient.GetPageOfAccounts(int pageNumber, int pageSize, DateTime? toDate) { throw new NotImplementedException(); From c78b08984a8771620963668e25c487421c38aca1 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Wed, 22 Aug 2018 08:26:55 +0100 Subject: [PATCH 19/22] create and switch to TestHelper.Clone --- ...ommitments.Infrastructure.UnitTests.csproj | 1 + .../WhenIMapAFramework.cs | 17 +++++---------- .../WhenIMapAStandard.cs | 17 +++++---------- .../TestHelper.cs | 21 +++++++++++++++++++ 4 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 src/SFA.DAS.Commitments.Infrastructure.UnitTests/TestHelper.cs diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj index f80aaeb07a..63dd90cda4 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/SFA.DAS.Commitments.Infrastructure.UnitTests.csproj @@ -128,6 +128,7 @@ + diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs index d329d6e52e..4459edf3ef 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using KellermanSoftware.CompareNetObjects; -using Newtonsoft.Json; using NUnit.Framework; using SFA.DAS.Apprenticeships.Api.Types; using SFA.DAS.Commitments.Infrastructure.Services; @@ -41,7 +40,7 @@ public void Arrange() public void ThenTitleIsMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_framework) }); //Assert var expectedTitle = $"{_framework.Title}, Level: {_framework.Level}"; @@ -52,7 +51,7 @@ public void ThenTitleIsMappedCorrectly() public void ThenEffectiveFromIsMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_framework) }); //Assert Assert.AreEqual(_framework.EffectiveFrom, result.Frameworks[0].EffectiveFrom); @@ -62,7 +61,7 @@ public void ThenEffectiveFromIsMappedCorrectly() public void ThenEffectiveToIsMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_framework) }); //Assert Assert.AreEqual(_framework.EffectiveFrom, result.Frameworks[0].EffectiveFrom); @@ -73,7 +72,7 @@ public void ThenEffectiveToIsMappedCorrectly() public void ThenFundingPeriodsAreMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_framework) }); //Assert var comparer = new CompareLogic(new ComparisonConfig @@ -91,17 +90,11 @@ public void ThenFundingPeriodsAreMappedCorrectlyWhenNull() _framework.FundingPeriods = null; //Act - var result = _mapper.MapFrom(new List { CopyOf(_framework) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_framework) }); //Assert Assert.IsNotNull(result.Frameworks[0].FundingPeriods); Assert.IsEmpty(result.Frameworks[0].FundingPeriods); } - - private static FrameworkSummary CopyOf(FrameworkSummary source) - { - //copy the payload to guard against handler modifications - return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source)); - } } } \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs index a257e72aa9..7f1389ff5b 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAStandard.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using KellermanSoftware.CompareNetObjects; -using Newtonsoft.Json; using NUnit.Framework; using SFA.DAS.Apprenticeships.Api.Types; using SFA.DAS.Commitments.Infrastructure.Services; @@ -39,7 +38,7 @@ public void Arrange() public void ThenTitleIsMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_standard) }); //Assert var expectedTitle = $"{_standard.Title}, Level: {_standard.Level} (Standard)"; @@ -50,7 +49,7 @@ public void ThenTitleIsMappedCorrectly() public void ThenEffectiveFromIsMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_standard) }); //Assert Assert.AreEqual(_standard.EffectiveFrom, result.Standards[0].EffectiveFrom); @@ -60,7 +59,7 @@ public void ThenEffectiveFromIsMappedCorrectly() public void ThenEffectiveToIsMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_standard) }); //Assert Assert.AreEqual(_standard.LastDateForNewStarts, result.Standards[0].EffectiveTo); @@ -70,7 +69,7 @@ public void ThenEffectiveToIsMappedCorrectly() public void ThenFundingPeriodsAreMappedCorrectly() { //Act - var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_standard) }); var comparer = new CompareLogic(new ComparisonConfig { @@ -87,17 +86,11 @@ public void ThenFundingPeriodsAreMappedCorrectlyWhenNull() _standard.FundingPeriods = null; //Act - var result = _mapper.MapFrom(new List { CopyOf(_standard) }); + var result = _mapper.MapFrom(new List { TestHelper.Clone(_standard) }); //Assert Assert.IsNotNull(result.Standards[0].FundingPeriods); Assert.IsEmpty(result.Standards[0].FundingPeriods); } - - private static StandardSummary CopyOf(StandardSummary source) - { - //copy the payload to guard against handler modifications - return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source)); - } } } \ No newline at end of file diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/TestHelper.cs b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/TestHelper.cs new file mode 100644 index 0000000000..bfaa683183 --- /dev/null +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/TestHelper.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using KellermanSoftware.CompareNetObjects; +using Newtonsoft.Json; + +namespace SFA.DAS.Commitments.Infrastructure.UnitTests +{ + public static class TestHelper + { + public static T Clone(T source) + { + var serialized = JsonConvert.SerializeObject(source); + return JsonConvert.DeserializeObject(serialized); + } + + public static bool EnumerablesAreEqual(IEnumerable expected, IEnumerable actual) + { + return new CompareLogic(new ComparisonConfig { IgnoreObjectTypes = true }) + .Compare(expected, actual).AreEqual; + } + } +} From f152581d898fc83dd34c3c73b8adfcfbd50cd675 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Wed, 22 Aug 2018 09:03:59 +0100 Subject: [PATCH 20/22] a lack of common interfaces between FrameworkSummary and StandardSummary makes common methods too convoluted --- .../Services/ApprenticeshipInfoService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs index 2a9ddced96..5685979d9e 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs +++ b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs @@ -26,7 +26,6 @@ public ApprenticeshipInfoService(ICache cache, _mapper = mapper; } - //todo: private helper for common code? public async Task GetStandardsAsync(bool refreshCache = false) { if (!await _cache.ExistsAsync(StandardsKey) || refreshCache) From 1e4cf981cf5668cbda7993ae97ffbd062546f2b3 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 28 Aug 2018 10:42:36 +0100 Subject: [PATCH 21/22] switch to using new test helper method EnumerablesAreEqual --- .../WhenIMapAFramework.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs index 4459edf3ef..80ce0cc8fd 100644 --- a/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs +++ b/src/SFA.DAS.Commitments.Infrastructure.UnitTests/Services/ApprenticeshipInfoServiceMapperTests/WhenIMapAFramework.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using KellermanSoftware.CompareNetObjects; using NUnit.Framework; using SFA.DAS.Apprenticeships.Api.Types; using SFA.DAS.Commitments.Infrastructure.Services; @@ -75,12 +74,7 @@ public void ThenFundingPeriodsAreMappedCorrectly() var result = _mapper.MapFrom(new List { TestHelper.Clone(_framework) }); //Assert - var comparer = new CompareLogic(new ComparisonConfig - { - IgnoreObjectTypes = true - }); - - Assert.IsTrue(comparer.Compare(result.Frameworks[0].FundingPeriods, _framework.FundingPeriods).AreEqual); + Assert.IsTrue(TestHelper.EnumerablesAreEqual(_framework.FundingPeriods, result.Frameworks[0].FundingPeriods)); } [Test] From 1e6385817836fb8d8d05773a596a8b2dc5d871e7 Mon Sep 17 00:00:00 2001 From: Phil Davies Date: Tue, 28 Aug 2018 11:10:52 +0100 Subject: [PATCH 22/22] rename GetXxxAsync -> GetXxx + optimisation and tidy up --- .../WhenApprovingDataLockTriage.cs | 10 ++++----- .../ApproveDataLockTriageCommandHandler.cs | 2 +- .../Interfaces/IApprenticeshipInfoService.cs | 7 +++---- .../Services/ApprenticeshipInfoService.cs | 21 ++++++++----------- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs b/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs index 6c62dc77e7..bad3cfa6b2 100644 --- a/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs +++ b/src/SFA.DAS.Commitments.Application.UnitTests/Commands/ApproveDataLockTriage/WhenApprovingDataLockTriage.cs @@ -257,7 +257,7 @@ public async Task ShouldNotUpdateApprenticeshipIfApprenticeshipHasHadSuccessData _dataLockRepository.Verify(m => m.ResolveDataLock(It.IsAny>()), Times.Once); - _apprenticeshipTrainingService.Verify(m => m.GetTrainingProgramAsync(It.IsAny(), false), Times.Never); + _apprenticeshipTrainingService.Verify(m => m.GetTrainingProgram(It.IsAny()), Times.Never); _apprenticeshipRepository.Verify(m => m.UpdateApprenticeship(It.IsAny(), new Caller()), Times.Never); } @@ -280,7 +280,7 @@ public async Task ShouldUpdateApprenticeshipIfCourseHasChanged() _apprenticeshipRepository.Setup(m => m.GetApprenticeship(_command.ApprenticeshipId)) .ReturnsAsync(new Apprenticeship { CommitmentId = 123456L, HasHadDataLockSuccess = false, EmployerAccountId = 12345 }); - _apprenticeshipTrainingService.Setup(m => m.GetTrainingProgramAsync($"{trainingCode}", false)) + _apprenticeshipTrainingService.Setup(m => m.GetTrainingProgram($"{trainingCode}")) .ReturnsAsync(standard); Apprenticeship updatedApprenticeship = null; @@ -293,7 +293,7 @@ public async Task ShouldUpdateApprenticeshipIfCourseHasChanged() _dataLockRepository.Verify(m => m.ResolveDataLock(It.IsAny>()), Times.Once); - _apprenticeshipTrainingService.Verify(m => m.GetTrainingProgramAsync(standard.Code.ToString(), false), Times.Once); + _apprenticeshipTrainingService.Verify(m => m.GetTrainingProgram(standard.Code.ToString()), Times.Once); _apprenticeshipRepository.Verify(m => m.UpdateApprenticeship(It.IsAny(), It.IsAny()), Times.Once); updatedApprenticeship.TrainingCode.Should().Be(standard.Code.ToString()); @@ -320,14 +320,14 @@ public async Task ShouldNotUpdateApprenticeshipIfCourseIsTheSame() _apprenticeshipRepository.Setup(m => m.GetApprenticeship(_command.ApprenticeshipId)) .ReturnsAsync(new Apprenticeship { CommitmentId = 123456L, HasHadDataLockSuccess = false, EmployerAccountId = 12345, TrainingCode = $"{trainingCode}"}); - _apprenticeshipTrainingService.Setup(m => m.GetTrainingProgramAsync($"{trainingCode}", false)) + _apprenticeshipTrainingService.Setup(m => m.GetTrainingProgram($"{trainingCode}")) .ReturnsAsync(standard); await _sut.Handle(_command); _dataLockRepository.Verify(m => m.ResolveDataLock(It.IsAny>()), Times.Once); - _apprenticeshipTrainingService.Verify(m => m.GetTrainingProgramAsync(It.IsAny(), false), Times.Never); + _apprenticeshipTrainingService.Verify(m => m.GetTrainingProgram(It.IsAny()), Times.Never); _apprenticeshipRepository.Verify(m => m.UpdateApprenticeship(It.IsAny(), It.IsAny()), Times.Never); } diff --git a/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs b/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs index 906b9e715b..31c938ce14 100644 --- a/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs +++ b/src/SFA.DAS.Commitments.Application/Commands/ApproveDataLockTriage/ApproveDataLockTriageCommandHandler.cs @@ -83,7 +83,7 @@ protected override async Task HandleCore(ApproveDataLockTriageCommand command) if (dataLockWithUpdatedTraining != null) { var training = await - _apprenticeshipTrainingService.GetTrainingProgramAsync(dataLockWithUpdatedTraining.IlrTrainingCourseCode); + _apprenticeshipTrainingService.GetTrainingProgram(dataLockWithUpdatedTraining.IlrTrainingCourseCode); _logger.Info($"Updating course for apprenticeship {apprenticeship.Id} from training code {apprenticeship.TrainingCode} to {dataLockWithUpdatedTraining.IlrTrainingCourseCode}"); diff --git a/src/SFA.DAS.Commitments.Application/Interfaces/IApprenticeshipInfoService.cs b/src/SFA.DAS.Commitments.Application/Interfaces/IApprenticeshipInfoService.cs index 98fb168508..197d2c49b7 100644 --- a/src/SFA.DAS.Commitments.Application/Interfaces/IApprenticeshipInfoService.cs +++ b/src/SFA.DAS.Commitments.Application/Interfaces/IApprenticeshipInfoService.cs @@ -1,13 +1,12 @@ using System.Threading.Tasks; - using SFA.DAS.Commitments.Domain.Entities.TrainingProgramme; namespace SFA.DAS.Commitments.Application.Interfaces { public interface IApprenticeshipInfoService { - Task GetStandardsAsync(bool refreshCache = false); - Task GetFrameworksAsync(bool refreshCache = false); - Task GetTrainingProgramAsync(string id, bool refreshCache = false); + Task GetStandards(bool refreshCache = false); + Task GetFrameworks(bool refreshCache = false); + Task GetTrainingProgram(string id); } } diff --git a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs index 5685979d9e..a3874d8452 100644 --- a/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs +++ b/src/SFA.DAS.Commitments.Infrastructure/Services/ApprenticeshipInfoService.cs @@ -1,6 +1,5 @@ using System.Linq; using System.Threading.Tasks; - using SFA.DAS.Apprenticeships.Api.Client; using SFA.DAS.Commitments.Application.Interfaces; using SFA.DAS.Commitments.Domain.Entities.TrainingProgramme; @@ -26,7 +25,7 @@ public ApprenticeshipInfoService(ICache cache, _mapper = mapper; } - public async Task GetStandardsAsync(bool refreshCache = false) + public async Task GetStandards(bool refreshCache = false) { if (!await _cache.ExistsAsync(StandardsKey) || refreshCache) { @@ -40,7 +39,7 @@ public async Task GetStandardsAsync(bool refreshCache = false) return await _cache.GetCustomValueAsync(StandardsKey); } - public async Task GetFrameworksAsync(bool refreshCache = false) + public async Task GetFrameworks(bool refreshCache = false) { if (!await _cache.ExistsAsync(FrameworksKey) || refreshCache) { @@ -54,18 +53,16 @@ public async Task GetFrameworksAsync(bool refreshCache = false) return await _cache.GetCustomValueAsync(FrameworksKey); } - public async Task GetTrainingProgramAsync(string id, bool refreshCache = false) + public async Task GetTrainingProgram(string id) { - var standardsTask = GetStandardsAsync(); - var frameworksTask = GetFrameworksAsync(); - - await Task.WhenAll(standardsTask, frameworksTask); + var standardsTask = GetStandards(); + var frameworksTask = GetFrameworks(); - var programmes = standardsTask.Result.Standards.Union(frameworksTask.Result.Frameworks.Cast()) - .OrderBy(m => m.Title) - .ToList(); + var program = (await standardsTask).Standards.FirstOrDefault(m => m.Id == id); + if (program != null) + return program; - return programmes.FirstOrDefault(m => m.Id == id); + return (await frameworksTask).Frameworks.FirstOrDefault(m => m.Id == id); } } } \ No newline at end of file