Beispiel #1
0
        public void Constructor_WithAllParams_ShouldNotThrowException()
        {
            var fixtures = new CreateCohortWithDraftApprenticeshipControllerTestFixtures();

            fixtures.CreateController();

            Assert.Pass("Created controller without exception");
        }
Beispiel #2
0
        public async Task PostAddDraftApprenticeship_WithValidModel_WithEnhancedApproval_ShouldRedirectToCohortDetailsV2()
        {
            var fixtures = new CreateCohortWithDraftApprenticeshipControllerTestFixtures()
                           .ForPostRequest()
                           .WithCreatedCohort("ABC123", 123);

            var result = await fixtures.CheckPost();

            result.VerifyReturnsRedirectToActionResult().WithActionName("Details");
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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");
        }