public void When_only_delegate_notifications_are_present_they_are_marked_to_not_show_as_expandable() { // given var adminNotifications = new List <NotificationPreference>(); var delegateNotifications = new List <NotificationPreference> { new NotificationPreference() }; // when var returnedModel = new NotificationPreferencesViewModel(adminNotifications, delegateNotifications, null); // then returnedModel.DelegateNotifications.ShowAsExpandable.Should().BeFalse(); }
public IActionResult Index(DlsSubApplication dlsSubApplication) { var adminId = User.GetCustomClaimAsInt(CustomClaimTypes.UserAdminId); var adminNotifications = notificationPreferencesService.GetNotificationPreferencesForUser(UserType.AdminUser, adminId); var delegateId = User.GetCandidateId(); var delegateNotifications = notificationPreferencesService.GetNotificationPreferencesForUser(UserType.DelegateUser, delegateId); var model = new NotificationPreferencesViewModel( adminNotifications, delegateNotifications, dlsSubApplication ); return(View(model)); }