public void SetNotificationPreferencesForUser(UserType userType, int?userId, IEnumerable <int> notificationIds)
 {
     if (userType.Equals(UserType.AdminUser))
     {
         notificationPreferencesDataService.SetNotificationPreferencesForAdmin(userId, notificationIds);
     }
     else if (userType.Equals(UserType.DelegateUser))
     {
         notificationPreferencesDataService.SetNotificationPreferencesForDelegate(userId, notificationIds);
     }
     else
     {
         throw new Exception($"No code path for setting notification preferences for user type {userType}");
     }
 }
Esempio n. 2
0
        public void Sets_preferences_for_delegate_when_user_type_is_delegate()
        {
            // Given
            var userType = UserType.DelegateUser;

            // When
            notificationPreferencesService.SetNotificationPreferencesForUser(userType, 1, new int[] { });

            // Then
            A.CallTo(
                () => notificationPreferencesDataService.SetNotificationPreferencesForDelegate(
                    1,
                    A <IEnumerable <int> > .That.IsEmpty()))
            .MustHaveHappened(1, Times.Exactly);
        }