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}"); } }
public void Sets_preferences_for_admin_when_user_type_is_admin() { // Given var userType = UserType.AdminUser; // When notificationPreferencesService.SetNotificationPreferencesForUser(userType, 1, new int[] { }); // Then A.CallTo( () => notificationPreferencesDataService.SetNotificationPreferencesForAdmin( 1, A <IEnumerable <int> > .That.IsEmpty())) .MustHaveHappened(1, Times.Exactly); }