public async Task ThenWhatHappensNextIsPopulatedCorrectly(bool isTransfer, SaveStatus saveStatus, ExpectedWhatHappensNextType expectedWhatHappensNextType) { var fixture = new WhenMappingAcknowledgementRequestToViewModelTestsFixture(); fixture.Cohort.TransferSenderId = isTransfer ? 100 : default(long?); fixture.Cohort.ChangeOfPartyRequestId = isTransfer ? default(long?) : 100; fixture.CommitmentsApiClient .Setup(x => x.GetCohort(It.IsAny <long>(), It.IsAny <CancellationToken>())) .ReturnsAsync(fixture.Cohort); fixture.Source.SaveStatus = saveStatus; var result = await fixture.Map(); string[] expectedWhatHappensNext; switch (expectedWhatHappensNextType) { case ExpectedWhatHappensNextType.TransferFirstApproval: expectedWhatHappensNext = new[] { "The employer will review the cohort and either approve or contact you with an update.", "Once the employer approves the cohort, a transfer request will be sent to the funding employer to review.", "You’ll receive a notification when the funding employer approves or rejects the transfer request." }; break; case ExpectedWhatHappensNextType.EmployerWillReview: expectedWhatHappensNext = new[] { "The employer will review the cohort and either approve it or contact you with an update." }; break; case ExpectedWhatHappensNextType.UpdatedCohort: expectedWhatHappensNext = new[] { "The updated cohort will appear in the employer’s account for them to review." }; break; default: throw new NotImplementedException(); } CollectionAssert.AreEquivalent(expectedWhatHappensNext, result.WhatHappensNext); }
//[TestCase(false, SaveStatus.Save, ExpectedWhatHappensNextType.UpdatedCohort)] public async Task ThenWhatHappensNextIsPopulatedCorrectly(bool isTransfer, SaveStatus saveStatus, ExpectedWhatHappensNextType expectedWhatHappensNextType) { if (isTransfer) { _commitment.TransferSender = new TransferSender(); } var viewModel = await _orchestrator.GetAcknowledgementViewModel(1, "Hashed-Id", saveStatus); string[] expectedWhatHappensNext; switch (expectedWhatHappensNextType) { case ExpectedWhatHappensNextType.TransferFirstApproval: expectedWhatHappensNext = new[] { "The employer will receive your cohort and will either confirm the information is correct or contact you to suggest changes.", "Once the employer approves the cohort, a transfer request will be sent to the funding employer to review.", "You will receive a notification once the funding employer approves or rejects the transfer request. You can view the progress of a request from the 'With transfer sending employers' status screen." }; break; case ExpectedWhatHappensNextType.EmployerWillReview: expectedWhatHappensNext = new[] { "The employer will review the cohort and either approve it or contact you with an update." }; break; case ExpectedWhatHappensNextType.UpdatedCohort: expectedWhatHappensNext = new[] { "The updated cohort will appear in the employer’s account for them to review." }; break; default: throw new NotImplementedException(); } CollectionAssert.AreEquivalent(expectedWhatHappensNext, viewModel.WhatHappensNext); }