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

            fixtures.CreateController();

            Assert.Pass("Created controller without exception");
        }
示例#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");
        }
示例#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);
        }
示例#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");
        }