From cb706c67a1b340d1e892003325e1256663771cfb Mon Sep 17 00:00:00 2001 From: Paul Graham Date: Fri, 17 Apr 2020 12:04:47 +0100 Subject: [PATCH 1/3] added ProviderId to the GetCohorts query --- .../Controllers/CohortController.cs | 2 +- .../GetCohorts/GetCohortsHandlerTests.cs | 143 +++++++++++++----- .../GetCohortsQueryValidationTests.cs | 10 +- .../Validators/GetCohortsRequestTests.cs | 28 ++-- .../Queries/GetCohorts/GetCohortsHandler.cs | 7 +- .../Queries/GetCohorts/GetCohortsQuery.cs | 4 +- .../GetCohorts/GetCohortsQueryValidator.cs | 2 +- .../Validators/GetCohortsRequestValidator.cs | 2 +- 8 files changed, 125 insertions(+), 73 deletions(-) diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs index 0d4b81d01d..022752a8f9 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs @@ -31,7 +31,7 @@ public CohortController(IMediator mediator) [HttpGet] public async Task GetCohorts([FromQuery] GetCohortsRequest request) { - var query = new GetCohortsQuery(request.AccountId); + var query = new GetCohortsQuery(request.AccountId, request.ProviderId); var result = await _mediator.Send(query); return Ok(new GetCohortsResponse(result.Cohorts)); diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs index d2bf5c4bf0..92ed341575 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs @@ -22,27 +22,27 @@ public class GetCohortsHandlerTests public async Task Handle_WithAccountId_ShouldReturnDraftUnapprovedCohortsForThatEmployer() { var f = new GetCohortsHandlerTestFixtures(); - f.AddEmptyDraftCohortForEmployer(f.AccountId); + f.AddEmptyDraftCohortWithEmployer(f.AccountId); - var response = await f.GetResponse(new GetCohortsQuery(f.AccountId)); + var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null)); Assert.IsNotNull(response); - Assert.AreEqual(response.Cohorts.Length, f.SeedCohorts.Count); - Assert.AreEqual(response.Cohorts[0].AccountId, f.AccountId); - Assert.AreEqual(response.Cohorts[0].LegalEntityName, f.SeedCohorts[0].LegalEntityName); - Assert.AreEqual(response.Cohorts[0].ProviderId, f.SeedCohorts[0].ProviderId); - Assert.AreEqual(response.Cohorts[0].ProviderName, f.SeedCohorts[0].ProviderName); - Assert.AreEqual(response.Cohorts[0].CohortId, f.SeedCohorts[0].Id); - Assert.AreEqual(response.Cohorts[0].CreatedOn, f.SeedCohorts[0].CreatedOn); + Assert.AreEqual(f.SeedCohorts.Count, response.Cohorts.Length); + Assert.AreEqual(f.AccountId, response.Cohorts[0].AccountId); + Assert.AreEqual(f.SeedCohorts[0].LegalEntityName, response.Cohorts[0].LegalEntityName); + Assert.AreEqual(f.SeedCohorts[0].ProviderId, response.Cohorts[0].ProviderId); + Assert.AreEqual(f.SeedCohorts[0].ProviderName, response.Cohorts[0].ProviderName); + Assert.AreEqual(f.SeedCohorts[0].Id, response.Cohorts[0].CohortId); + Assert.AreEqual(f.SeedCohorts[0].CreatedOn, response.Cohorts[0].CreatedOn); } [Test] public async Task Handle_WithAccountId_ShouldReturnEmptyMessagesAsNothingSent() { var f = new GetCohortsHandlerTestFixtures(); - f.AddEmptyDraftCohortForEmployer(f.AccountId); + f.AddEmptyDraftCohortWithEmployer(f.AccountId); - var response = await f.GetResponse(new GetCohortsQuery(f.AccountId)); + var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null)); Assert.IsNull(response.Cohorts[0].LatestMessageFromEmployer); Assert.IsNull(response.Cohorts[0].LatestMessageFromProvider); @@ -52,12 +52,12 @@ public async Task Handle_WithAccountId_ShouldReturnEmptyMessagesAsNothingSent() public async Task Handle_WithAccountIdWithNoCohorts_ShouldReturnEmptyList() { var f = new GetCohortsHandlerTestFixtures(); - f.AddEmptyDraftCohortForEmployer(f.AccountId); + f.AddEmptyDraftCohortWithEmployer(f.AccountId); - var response = await f.GetResponse(new GetCohortsQuery(f.NonMatchingAccountId)); + var response = await f.GetResponse(new GetCohortsQuery(f.NonMatchingId, null)); Assert.IsNotNull(response); - Assert.AreEqual(response.Cohorts.Length, 0); + Assert.AreEqual(0, response.Cohorts.Length); } [Test] @@ -66,10 +66,10 @@ public async Task Handle_WithAccountIdWithApprovedCohort_ShouldReturnEmptyList() var f = new GetCohortsHandlerTestFixtures(); f.AddCohortForEmployerApprovedByBoth(f.AccountId); - var response = await f.GetResponse(new GetCohortsQuery(f.AccountId)); + var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null)); Assert.IsNotNull(response); - Assert.AreEqual(response.Cohorts.Length, 0); + Assert.AreEqual(0, response.Cohorts.Length); } [Test] @@ -78,10 +78,10 @@ public async Task Handle_WithAccountIdWithTransferApprovedCohort_ShouldReturnEmp var f = new GetCohortsHandlerTestFixtures(); f.AddTransferCohortForEmployerAndApprovedByAll(f.AccountId); - var response = await f.GetResponse(new GetCohortsQuery(f.AccountId)); + var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null)); Assert.IsNotNull(response); - Assert.AreEqual(response.Cohorts.Length, 0); + Assert.AreEqual(0, response.Cohorts.Length); } [Test] @@ -90,12 +90,12 @@ public async Task Handle_WithAccountId_CohortWithTransferSender_ShouldReturnTran var f = new GetCohortsHandlerTestFixtures(); f.AddCohortWithTransferSender(f.AccountId); - var response = await f.GetResponse(new GetCohortsQuery(f.AccountId)); + var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null)); Assert.IsNotNull(response); - Assert.AreEqual(response.Cohorts.Length, 1); - Assert.AreEqual(response.Cohorts[0].TransferSenderId, f.TransferSenderId); - Assert.AreEqual(response.Cohorts[0].TransferSenderName, "TransferSender"); + Assert.AreEqual(1, response.Cohorts.Length); + Assert.AreEqual(f.TransferSenderId, response.Cohorts[0].TransferSenderId); + Assert.AreEqual("TransferSender", response.Cohorts[0].TransferSenderName); } [Test] @@ -104,20 +104,85 @@ public async Task Handle_WithAccountIdWithMixedCohorts_ShouldReturn2CohortsAndEx var f = new GetCohortsHandlerTestFixtures(); f.AddUnapprovedCohortForEmployerWithMessagesAnd2Apprentices(f.AccountId) .AddUnapprovedCohortForEmployerWithMessagesAnd2Apprentices(f.AccountId) - .AddUnapprovedCohortForEmployerWithMessagesAnd2Apprentices(f.NonMatchingAccountId) + .AddUnapprovedCohortForEmployerWithMessagesAnd2Apprentices(f.NonMatchingId) .AddCohortForEmployerApprovedByBoth(f.AccountId); - var response = await f.GetResponse(new GetCohortsQuery(f.AccountId)); + var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null)); Assert.IsNotNull(response); - Assert.AreEqual(response.Cohorts.Length, 2); - Assert.AreEqual(response.Cohorts[0].LatestMessageFromEmployer.Text, "EmployerLast"); - Assert.AreEqual(response.Cohorts[0].LatestMessageFromProvider.Text, "ProviderLast"); - Assert.AreEqual(response.Cohorts[0].NumberOfDraftApprentices, 2); - Assert.AreEqual(response.Cohorts[1].LatestMessageFromEmployer.Text, "EmployerLast"); - Assert.AreEqual(response.Cohorts[1].LatestMessageFromProvider.Text, "ProviderLast"); - Assert.AreEqual(response.Cohorts[1].NumberOfDraftApprentices, 2); + Assert.AreEqual(2, response.Cohorts.Length); + Assert.AreEqual("EmployerLast", response.Cohorts[0].LatestMessageFromEmployer.Text); + Assert.AreEqual("ProviderLast", response.Cohorts[0].LatestMessageFromProvider.Text); + Assert.AreEqual(2, response.Cohorts[0].NumberOfDraftApprentices); + Assert.AreEqual("EmployerLast", response.Cohorts[1].LatestMessageFromEmployer.Text); + Assert.AreEqual("ProviderLast", response.Cohorts[1].LatestMessageFromProvider.Text); + Assert.AreEqual(2, response.Cohorts[1].NumberOfDraftApprentices); } + + [Test] + public async Task Handle_WithProviderId_ShouldReturnDraftUnapprovedCohortsForThatEmployer() + { + var f = new GetCohortsHandlerTestFixtures(); + f.AddEmptyDraftCohortWithEmployer(f.AccountId); + + var response = await f.GetResponse(new GetCohortsQuery(null, f.ProviderId)); + + Assert.IsNotNull(response); + Assert.AreEqual(f.SeedCohorts.Count, response.Cohorts.Length); + Assert.AreEqual(f.AccountId, response.Cohorts[0].AccountId); + Assert.AreEqual(f.SeedCohorts[0].LegalEntityName, response.Cohorts[0].LegalEntityName); + Assert.AreEqual(f.SeedCohorts[0].ProviderId, response.Cohorts[0].ProviderId); + Assert.AreEqual(f.SeedCohorts[0].ProviderName, response.Cohorts[0].ProviderName); + Assert.AreEqual(f.SeedCohorts[0].Id, response.Cohorts[0].CohortId); + Assert.AreEqual(f.SeedCohorts[0].CreatedOn, response.Cohorts[0].CreatedOn); + } + + [Test] + public async Task Handle_WithProviderIdWithNoCohorts_ShouldReturnEmptyList() + { + var f = new GetCohortsHandlerTestFixtures(); + f.AddEmptyDraftCohortWithEmployer(f.AccountId); + + var response = await f.GetResponse(new GetCohortsQuery(null, f.NonMatchingId)); + + Assert.IsNotNull(response); + Assert.AreEqual(0, response.Cohorts.Length); + } + + [Test] + public async Task Handle_WithProviderIdWithApprovedCohort_ShouldReturnEmptyList() + { + var f = new GetCohortsHandlerTestFixtures(); + f.AddCohortForEmployerApprovedByBoth(f.AccountId); + + var response = await f.GetResponse(new GetCohortsQuery(null, f.ProviderId)); + + Assert.IsNotNull(response); + Assert.AreEqual(0, response.Cohorts.Length); + } + + [Test] + public async Task Handle_WithProviderIdWithMixedCohorts_ShouldReturn3CohortsForProviderIdAndExcludeApprovedCohorts() + { + var f = new GetCohortsHandlerTestFixtures(); + f.AddUnapprovedCohortForEmployerWithMessagesAnd2Apprentices(f.AccountId) + .AddUnapprovedCohortForEmployerWithMessagesAnd2Apprentices(f.AccountId) + .AddUnapprovedCohortForEmployerWithMessagesAnd2Apprentices(f.NonMatchingId) + .AddCohortForEmployerApprovedByBoth(f.AccountId); + + var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null)); + + Assert.IsNotNull(response); + Assert.AreEqual(2, response.Cohorts.Length); + Assert.AreEqual("EmployerLast", response.Cohorts[0].LatestMessageFromEmployer.Text); + Assert.AreEqual("ProviderLast", response.Cohorts[0].LatestMessageFromProvider.Text); + Assert.AreEqual(2, response.Cohorts[0].NumberOfDraftApprentices); + Assert.AreEqual("EmployerLast", response.Cohorts[1].LatestMessageFromEmployer.Text); + Assert.AreEqual("ProviderLast", response.Cohorts[1].LatestMessageFromProvider.Text); + Assert.AreEqual(2, response.Cohorts[1].NumberOfDraftApprentices); + } + + } public class GetCohortsHandlerTestFixtures @@ -130,17 +195,19 @@ public GetCohortsHandlerTestFixtures() SeedAccounts = new List(); _autoFixture = new Fixture(); AccountId = _autoFixture.Create(); + ProviderId = _autoFixture.Create(); TransferSenderId = AccountId + 1; TransferSender = new Account(TransferSenderId, "", "", "TransferSender", DateTime.UtcNow); Account = new Account(AccountId,"","","TEST", DateTime.UtcNow); AccountLegalEntity = new AccountLegalEntity(Account, 1,1, "", "","TEST", OrganisationType.Charities, "", DateTime.UtcNow); - Provider = new Provider(1, "TEST PROVIDER", DateTime.UtcNow, DateTime.UtcNow); + Provider = new Provider(ProviderId, "TEST PROVIDER", DateTime.UtcNow, DateTime.UtcNow); } public long AccountId { get; } + public long ProviderId { get; } public long TransferSenderId { get; set; } - public long NonMatchingAccountId => AccountId + 100; + public long NonMatchingId => AccountId + 100; public List SeedCohorts { get; } public List SeedAccounts { get; } public Account Account { get; } @@ -160,7 +227,7 @@ public Task GetResponse(GetCohortsQuery query) }); } - public GetCohortsHandlerTestFixtures AddEmptyDraftCohortForEmployer(long accountId) + public GetCohortsHandlerTestFixtures AddEmptyDraftCohortWithEmployer(long? accountId) { var cohort = _autoFixture.Build().With(o=>o.EmployerAccountId, accountId) .With(o => o.EditStatus, EditStatus.Neither) @@ -171,8 +238,6 @@ public GetCohortsHandlerTestFixtures AddEmptyDraftCohortForEmployer(long account .Without(o => o.TransferSender) .Without(o => o.TransferRequests) .Without(o => o.Messages) - .Without(o => o.AccountLegalEntity) - .Without(o => o.Provider) .Create(); SeedCohorts.Add(cohort); @@ -193,8 +258,6 @@ public GetCohortsHandlerTestFixtures AddCohortForEmployerApprovedByBoth(long acc .Without(o => o.Apprenticeships) .Without(o => o.TransferRequests) .Without(o => o.Messages) - .Without(o => o.AccountLegalEntity) - .Without(o => o.Provider) .Create(); SeedCohorts.Add(cohort); @@ -214,8 +277,6 @@ public GetCohortsHandlerTestFixtures AddTransferCohortForEmployerAndApprovedByAl .Without(o => o.Apprenticeships) .Without(o => o.TransferRequests) .Without(o => o.Messages) - .Without(o => o.AccountLegalEntity) - .Without(o => o.Provider) .Create(); SeedCohorts.Add(cohort); @@ -255,8 +316,6 @@ public GetCohortsHandlerTestFixtures AddUnapprovedCohortForEmployerWithMessagesA .Without(o => o.TransferRequests) .Without(o => o.TransferSender) .Without(o => o.Messages) - .Without(o => o.AccountLegalEntity) - .Without(o => o.Provider) .Create(); cohort.Apprenticeships.Add(new DraftApprenticeship()); diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsQueryValidationTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsQueryValidationTests.cs index 00368271a5..b0f5011c0d 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsQueryValidationTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsQueryValidationTests.cs @@ -6,13 +6,15 @@ namespace SFA.DAS.CommitmentsV2.UnitTests.Application.Queries.GetCohorts [TestFixture] public class GetCohortsQueryValidationTests { - [TestCase(1, true)] - [TestCase(null, false)] - public void Validate_WithAccountId_ShouldSetIsValidCorrectly(long? id, bool expectedIsValid) + [TestCase(1, null, true)] + [TestCase(null, null, false)] + [TestCase(null, 1, true)] + [TestCase(1, 1, true)] + public void Validate_WithAccountIdAndProviderId_ShouldSetIsValidCorrectly(long? accountId, long? providerId, bool expectedIsValid) { // arrange var validator = new GetCohortsQueryValidator(); - var validationResults = validator.Validate(new GetCohortsQuery(id)); + var validationResults = validator.Validate(new GetCohortsQuery(accountId, providerId)); // act var actualIsValid = validationResults.IsValid; diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Validators/GetCohortsRequestTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Validators/GetCohortsRequestTests.cs index c96d99e8a9..2816d0f40c 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Validators/GetCohortsRequestTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Validators/GetCohortsRequestTests.cs @@ -1,6 +1,4 @@ -using System; -using System.Linq.Expressions; -using FluentValidation.TestHelper; +using FluentValidation.TestHelper; using NUnit.Framework; using SFA.DAS.CommitmentsV2.Api.Types.Requests; using SFA.DAS.CommitmentsV2.Validators; @@ -10,25 +8,17 @@ namespace SFA.DAS.CommitmentsV2.UnitTests.Validators [TestFixture] public class GetCohortsRequestTests { - [TestCase(1, true)] - [TestCase(null, false)] - public void Validate_AccountId_ShouldBeValidated(long? value, bool expectedValid) - { - AssertValidationResult(request => request.AccountId, value, expectedValid); - } - - private void AssertValidationResult(Expression> property, T value, bool expectedValid) + [TestCase(1, null, true)] + [TestCase(null, null, false)] + [TestCase(null, 1, true)] + [TestCase(1, 1, true)] + public void Validate_AccountIdAndProviderId_ShouldBeValidated(long? accountId, long? providerId, bool expectedValid) { + var request = new GetCohortsRequest { AccountId = accountId, ProviderId = providerId }; var validator = new GetCohortsRequestValidator(); - if (expectedValid) - { - validator.ShouldNotHaveValidationErrorFor(property, value); - } - else - { - validator.ShouldHaveValidationErrorFor(property, value); - } + var result = validator.TestValidate(request); + Assert.AreEqual(expectedValid, result.Result.IsValid); } } } \ No newline at end of file diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsHandler.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsHandler.cs index 5a4f95fce9..c214d6a6be 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsHandler.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsHandler.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using MediatR; @@ -30,9 +29,9 @@ public async Task Handle(GetCohortsQuery command, Cancellation var cohortFiltered = await (from c in _db.Value.Cohorts join a in _db.Value.Accounts on c.TransferSenderId equals a.Id into account from transferSender in account.DefaultIfEmpty() - where c.EmployerAccountId == command.AccountId && - (c.EditStatus != EditStatus.Both || - (c.TransferSenderId != null && c.TransferApprovalStatus != TransferApprovalStatus.Approved)) + where c.EmployerAccountId == (command.AccountId ?? c.EmployerAccountId) && c.ProviderId == (command.ProviderId ?? c.ProviderId) && + (c.EditStatus != EditStatus.Both || + (c.TransferSenderId != null && c.TransferApprovalStatus != TransferApprovalStatus.Approved)) select new CohortSummary { AccountId = c.EmployerAccountId, diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQuery.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQuery.cs index 6d8dfcea7d..c42c502adf 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQuery.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQuery.cs @@ -5,10 +5,12 @@ namespace SFA.DAS.CommitmentsV2.Application.Queries.GetCohorts public class GetCohortsQuery : IRequest { public long? AccountId { get; } + public long? ProviderId { get; } - public GetCohortsQuery(long? accountId) + public GetCohortsQuery(long? accountId, long? providerId) { AccountId = accountId; + ProviderId = providerId; } } } \ No newline at end of file diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQueryValidator.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQueryValidator.cs index 94da1e8afb..bd5168ad85 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQueryValidator.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohorts/GetCohortsQueryValidator.cs @@ -6,7 +6,7 @@ public class GetCohortsQueryValidator : AbstractValidator { public GetCohortsQueryValidator() { - RuleFor(model => model.AccountId).NotNull().WithMessage("The Account Id must be supplied"); + RuleFor(model => model).Must(m=>m.ProviderId != null || m.AccountId != null).WithMessage("The Account Id or Provider Id must be supplied"); } } } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Validators/GetCohortsRequestValidator.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Validators/GetCohortsRequestValidator.cs index 580384b9e8..59bc6d6537 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Validators/GetCohortsRequestValidator.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Validators/GetCohortsRequestValidator.cs @@ -7,7 +7,7 @@ public class GetCohortsRequestValidator : AbstractValidator { public GetCohortsRequestValidator() { - RuleFor(r => r.AccountId).NotNull(); + RuleFor(request => request).Must(r => r.ProviderId != null || r.AccountId != null).WithMessage("The Account Id or Provider Id must be supplied"); } } } \ No newline at end of file From d40bd1d832e171c322865c8e6505b5f9864a4cc6 Mon Sep 17 00:00:00 2001 From: Paul Graham Date: Tue, 21 Apr 2020 08:24:53 +0100 Subject: [PATCH 2/3] removed white spaces --- .../Application/Queries/GetCohorts/GetCohortsHandlerTests.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs index 92ed341575..7f191648e4 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohorts/GetCohortsHandlerTests.cs @@ -120,7 +120,7 @@ public async Task Handle_WithAccountIdWithMixedCohorts_ShouldReturn2CohortsAndEx } [Test] - public async Task Handle_WithProviderId_ShouldReturnDraftUnapprovedCohortsForThatEmployer() + public async Task Handle_WithProviderId_ShouldReturnDraftUnapprovedCohortsForThatProvider() { var f = new GetCohortsHandlerTestFixtures(); f.AddEmptyDraftCohortWithEmployer(f.AccountId); @@ -181,8 +181,6 @@ public async Task Handle_WithProviderIdWithMixedCohorts_ShouldReturn3CohortsForP Assert.AreEqual("ProviderLast", response.Cohorts[1].LatestMessageFromProvider.Text); Assert.AreEqual(2, response.Cohorts[1].NumberOfDraftApprentices); } - - } public class GetCohortsHandlerTestFixtures From 92623ff8e2ac74028fcc0897ae06060b12f4a3fd Mon Sep 17 00:00:00 2001 From: Paul Graham Date: Tue, 5 May 2020 10:18:32 +0100 Subject: [PATCH 3/3] removed post dedployment change for CV-684 --- .../PostDeployment/PostDeploymentScript.sql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql b/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql index cff2aeec6a..071af80ec4 100644 --- a/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql +++ b/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql @@ -12,7 +12,3 @@ Post-Deployment Script Template EXEC sp_refreshview [dbo.CommitmentSummaryWithMessages] - --- CV-684: set all accounts to levy initially, so that a manual script can set nonlevy back again --- This must be removed immediately after release -update [Accounts] set [LevyStatus]=1