Example #1
0
        public void Index_page_should_be_shown_by_index_method()
        {
            // Given
            var controller = new SupportTicketsController(featureManager, configuration)
                             .WithDefaultContext();

            // When
            var result = controller.Index(DlsSubApplication.TrackingSystem);

            // Then
            result.Should().BeViewResult().WithViewName("Index");
        }
Example #2
0
        public async Task Invalid_application_name_should_redirect_to_404_page()
        {
            // Given
            var controller = new SupportTicketsController(featureManager, configuration)
                             .WithDefaultContext()
                             .WithMockUser(true, isCentreAdmin: true, isFrameworkDeveloper: true);

            // When
            var result = await controller.Index(DlsSubApplication.Supervisor);

            // Then
            result.Should().BeNotFoundResult();
        }
Example #3
0
        public async Task Home_page_should_be_shown_when_accessing_tracking_system_supportTickets_without_appropriate_claims()
        {
            // Given
            var controller = new SupportTicketsController(featureManager, configuration)
                             .WithDefaultContext()
                             .WithMockUser(true, isCentreAdmin: false, isFrameworkDeveloper: true);

            // When
            var result = await controller.Index(DlsSubApplication.TrackingSystem);

            // Then
            result.Should().BeRedirectToActionResult().WithControllerName("Home").WithActionName("Index");
        }
Example #4
0
        public async Task Frameworks_SupportTickets_page_should_be_shown_for_valid_claims()
        {
            // Given
            var controller = new SupportTicketsController(featureManager, configuration)
                             .WithDefaultContext()
                             .WithMockUser(true, isCentreAdmin: false, isFrameworkDeveloper: true);

            // When
            var result = await controller.Index(DlsSubApplication.Frameworks);

            // Then
            result.Should().BeViewResult().WithViewName("Index");
        }
Example #5
0
        Home_page_should_be_shown_when_accessing_tracking_system_with_refactored_tracking_system_disabled()
        {
            // Given
            A.CallTo(() => featureManager.IsEnabledAsync(FeatureFlags.RefactoredTrackingSystem))
            .Returns(false);
            var controller = new SupportTicketsController(featureManager, configuration)
                             .WithDefaultContext()
                             .WithMockUser(true, isCentreAdmin: false, isFrameworkDeveloper: true);

            // When
            var result = await controller.Index(DlsSubApplication.TrackingSystem);

            // Then
            result.Should().BeRedirectToActionResult().WithControllerName("Home").WithActionName("Index");
        }