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"); }
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(); }
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"); }
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"); }
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"); }