public void Constructor_WithAllParams_ShouldNotThrowException() { var fixtures = new CreateCohortWithDraftApprenticeshipControllerTestFixtures(); fixtures.CreateController(); Assert.Pass("Created controller without exception"); }
public async Task PostAddDraftApprenticeship_WithValidModel_WithEnhancedApproval_ShouldRedirectToCohortDetailsV2() { var fixtures = new CreateCohortWithDraftApprenticeshipControllerTestFixtures() .ForPostRequest() .WithCreatedCohort("ABC123", 123); var result = await fixtures.CheckPost(); result.VerifyReturnsRedirectToActionResult().WithActionName("Details"); }
public async Task PostAddDraftApprenticeship_WithValidModel_ShouldSaveCohort() { var fixtures = new CreateCohortWithDraftApprenticeshipControllerTestFixtures() .ForPostRequest() .WithCreatedCohort("ABC123", 123) .WithReviewCohortLink("someurl") .WithTrainingProvider(); await fixtures.CheckPost(); fixtures.CommitmentsApiClientMock.Verify(cs => cs.CreateCohort(It.IsAny <CreateCohortRequest>(), It.IsAny <CancellationToken>()), Times.Once); }
public async Task GetAddDraftApprenticeship_ValidModel_ShouldReturnViewModel() { var fixtures = new CreateCohortWithDraftApprenticeshipControllerTestFixtures() .ForGetRequest() .WithTrainingProvider(); var result = await fixtures.CheckGet(); result .VerifyReturnsViewModel() .WithModel <ApprenticeViewModel>(); }
public async Task PostAddDraftApprenticeship_WithValidModel_WithEnhancedApproval_WithCourseSelected_ShouldRedirectToSelectOptions() { var fixtures = new CreateCohortWithDraftApprenticeshipControllerTestFixtures() .ForPostRequest() .SetupEncodingService() .WithCreatedCohort("ABC123", 123) .WithDraftApprenticeship(123, withCourseSelected: true); var result = await fixtures.CheckPost(); result.VerifyReturnsRedirectToActionResult().WithActionName("SelectOption"); }