private RequestResult <UserPreferenceModel> ExecuteCreateUserPreference(Database.Constants.DBStatusCode dbResultStatus = Database.Constants.DBStatusCode.Created) { UserPreferenceModel userPreferenceModel = new UserPreferenceModel { HdId = hdid, Preference = "TutorialPopover", Value = "mocked value", }; DBResult <UserPreference> readResult = new DBResult <UserPreference> { Payload = userPreferenceModel.ToDbModel(), Status = dbResultStatus }; Mock <IUserPreferenceDelegate> preferenceDelegateMock = new Mock <IUserPreferenceDelegate>(); preferenceDelegateMock.Setup(s => s.CreateUserPreference(It.IsAny <UserPreference>(), It.IsAny <bool>())).Returns(readResult); Mock <IEmailQueueService> emailer = new Mock <IEmailQueueService>(); Mock <IUserProfileDelegate> profileDelegateMock = new Mock <IUserProfileDelegate>(); Mock <IEmailDelegate> emailDelegateMock = new Mock <IEmailDelegate>(); Mock <IMessagingVerificationDelegate> emailInviteDelegateMock = new Mock <IMessagingVerificationDelegate>(); Mock <IConfigurationService> configServiceMock = new Mock <IConfigurationService>(); Mock <ILegalAgreementDelegate> legalAgreementDelegateMock = new Mock <ILegalAgreementDelegate>(); Mock <ICryptoDelegate> cryptoDelegateMock = new Mock <ICryptoDelegate>(); Mock <INotificationSettingsService> notificationServiceMock = new Mock <INotificationSettingsService>(); Mock <IMessagingVerificationDelegate> messageVerificationDelegateMock = new Mock <IMessagingVerificationDelegate>(); IUserProfileService service = new UserProfileService( new Mock <ILogger <UserProfileService> >().Object, new Mock <IPatientService>().Object, new Mock <IUserEmailService>().Object, new Mock <IUserSMSService>().Object, configServiceMock.Object, new Mock <IEmailQueueService>().Object, notificationServiceMock.Object, profileDelegateMock.Object, preferenceDelegateMock.Object, new Mock <ILegalAgreementDelegate>().Object, messageVerificationDelegateMock.Object, cryptoDelegateMock.Object, new Mock <IHttpContextAccessor>().Object); return(service.CreateUserPreference(userPreferenceModel)); }