public UserProfileBusinessLogicTests()
        {
            dynamicQueries           = Substitute.For <IDynamicQueries>();
            cosmosDbSettings         = Substitute.For <ICosmosDbSettings>();
            backendDatabaseService   = Substitute.For <IBackendDatabaseService>();
            userProfileBusinessLogic = new UserProfileBusinessLogic(dynamicQueries, cosmosDbSettings, backendDatabaseService);
            userProfileObj           = new UserProfile();

            cosmosDbSettings.AuthKey.Returns("dummykey");
            cosmosDbSettings.Endpoint.Returns(new System.Uri("https://bing.com"));
            cosmosDbSettings.DatabaseId.Returns("dbname");
            cosmosDbSettings.TopicsCollectionId.Returns("TopicCollection");
            cosmosDbSettings.ResourcesCollectionId.Returns("ResourceCollection");
            cosmosDbSettings.ProfilesCollectionId.Returns("UserProfile");

            //mock user data
            userProfileObj.Id                = "4589592f-3312-eca7-64ed-f3561bbb7398";
            userProfileObj.OId               = "709709e7t0r7t96";
            userProfileObj.FirstName         = "family1.2.1";
            userProfileObj.LastName          = " family1.2.2";
            userProfileObj.EMail             = "*****@*****.**";
            userProfileObj.IsActive          = "Yes";
            userProfileObj.CreatedBy         = "vn";
            userProfileObj.CreatedTimeStamp  = "01/01/2018 10:00:00";
            userProfileObj.ModifiedBy        = "vn";
            userProfileObj.ModifiedTimeStamp = "01/01/2018 10:00:00";
        }
 public UserProfileBusinessLogic(IDynamicQueries dynamicQueries, ICosmosDbSettings cosmosDbSettings,
                                 IBackendDatabaseService backendDatabaseService)
 {
     dbClient   = dynamicQueries;
     dbSettings = cosmosDbSettings;
     dbService  = backendDatabaseService;
 }
 public StateProvinceBusinessLogic(ICosmosDbSettings cosmosDbSettings, IBackendDatabaseService backendDatabaseService,
                                   IDynamicQueries dynamicQueries)
 {
     dbSettings = cosmosDbSettings;
     dbService  = backendDatabaseService;
     dbClient   = dynamicQueries;
 }
Exemple #4
0
 public OnboardingInfoBusinessLogic(IHttpClientService httpClientService, IOnboardingInfoSettings onboardingInfoSettings,
                                    IDynamicQueries dynamicQueries, ICosmosDbSettings dbSettings)
 {
     this.httpClientService      = httpClientService;
     this.onboardingInfoSettings = onboardingInfoSettings;
     this.dynamicQueries         = dynamicQueries;
     this.dbSettings             = dbSettings;
 }
 public PersonalizedPlanViewModelMapper(ICosmosDbSettings cosmosDbSettings, IDynamicQueries dynamicQueries,
                                        ITopicsResourcesBusinessLogic topicsResourcesBusinessLogic, IBackendDatabaseService backendDatabaseService)
 {
     this.cosmosDbSettings             = cosmosDbSettings;
     this.dynamicQueries               = dynamicQueries;
     this.topicsResourcesBusinessLogic = topicsResourcesBusinessLogic;
     this.backendDatabaseService       = backendDatabaseService;
 }
Exemple #6
0
        public StateProvinceBusinessLogicTests()
        {
            dbSettings = Substitute.For <ICosmosDbSettings>();
            dbService  = Substitute.For <IBackendDatabaseService>();
            dbClient   = Substitute.For <IDynamicQueries>();

            stateProvinceBusinessLogic = new StateProvinceBusinessLogic(dbSettings, dbService, dbClient);
            dbSettings.StateProvincesCollectionId.Returns("StateProvinces");
        }
 public UserRoleBusinessLogic(IDynamicQueries dynamicQueries, ICosmosDbSettings cosmosDbSettings,
                              IUserProfileBusinessLogic userProfileBusinessLogic,
                              IHttpContextAccessor httpContextAccessor, IOptions <AzureAdOptions> azureOptions)
 {
     dbClient                 = dynamicQueries;
     dbSettings               = cosmosDbSettings;
     dbUserProfile            = userProfileBusinessLogic;
     this.httpContextAccessor = httpContextAccessor;
     this.azureOptions        = azureOptions.Value;
 }
Exemple #8
0
        public UserRoleBusinessLogicTests()
        {
            dbClient              = Substitute.For <IDynamicQueries>();
            dbSettings            = Substitute.For <ICosmosDbSettings>();
            dbUserProfile         = Substitute.For <IUserProfileBusinessLogic>();
            httpContextAccessor   = Substitute.For <IHttpContextAccessor>();
            azureOptions          = Substitute.For <IOptions <AzureAdOptions> >();
            userRoleBusinessLogic = new UserRoleBusinessLogic(dbClient, dbSettings, dbUserProfile, httpContextAccessor, azureOptions);

            dbSettings.RolesCollectionId.Returns("UserRole");
        }
 public ShareBusinessLogic(IDynamicQueries dynamicQueries, ICosmosDbSettings cosmosDbSettings,
                           IBackendDatabaseService backendDatabaseService, IShareSettings shareSettings,
                           IUserProfileBusinessLogic userProfileBusinessLogic, IPersonalizedPlanBusinessLogic personalizedPlanBusinessLogic)
 {
     dbClient           = dynamicQueries;
     dbSettings         = cosmosDbSettings;
     dbService          = backendDatabaseService;
     dbShareSettings    = shareSettings;
     dbUserProfile      = userProfileBusinessLogic;
     dbPersonalizedPlan = personalizedPlanBusinessLogic;
 }
 public PersonalizedPlanBusinessLogic(ICosmosDbSettings cosmosDbSettings, IBackendDatabaseService backendDatabaseService,
                                      IDynamicQueries dynamicQueries, IUserProfileBusinessLogic userProfileBusinessLogic, IPersonalizedPlanEngine personalizedPlanEngine,
                                      IPersonalizedPlanViewModelMapper personalizedPlanViewModelMapper)
 {
     this.cosmosDbSettings                = cosmosDbSettings;
     this.backendDatabaseService          = backendDatabaseService;
     this.dynamicQueries                  = dynamicQueries;
     this.userProfileBusinessLogic        = userProfileBusinessLogic;
     this.personalizedPlanEngine          = personalizedPlanEngine;
     this.personalizedPlanViewModelMapper = personalizedPlanViewModelMapper;
 }
 public ServiceProvidersBusinessLogicTests()
 {
     dynamicQueries                = Substitute.For <IDynamicQueries>();
     cosmosDbSettings              = Substitute.For <ICosmosDbSettings>();
     backendDatabaseService        = Substitute.For <IBackendDatabaseService>();
     topicsResourcesSettings       = Substitute.For <ITopicsResourcesBusinessLogic>();
     serviceProvidersBusinessLogic = new ServiceProvidersBusinessLogic(dynamicQueries, cosmosDbSettings, backendDatabaseService);
     cosmosDbSettings.AuthKey.Returns("dummykey");
     cosmosDbSettings.Endpoint.Returns(new System.Uri("https://bing.com"));
     cosmosDbSettings.DatabaseId.Returns("dbname");
     cosmosDbSettings.TopicsCollectionId.Returns("TopicCollection");
     cosmosDbSettings.ResourcesCollectionId.Returns("ResourceCollection");
 }
Exemple #12
0
 public AdminBusinessLogic(IDynamicQueries dynamicQueries, ICosmosDbSettings cosmosDbSettings,
                           IBackendDatabaseService backendDatabaseService, IHostingEnvironment hostingEnvironment,
                           ICuratedExperienceConvertor a2jAuthorBuisnessLogic, IAdminSettings adminSettings,
                           ITopicsResourcesBusinessLogic topicsResourcesBusinessLogic)
 {
     this.dynamicQueries               = dynamicQueries;
     this.cosmosDbSettings             = cosmosDbSettings;
     this.backendDatabaseService       = backendDatabaseService;
     this.hostingEnvironment           = hostingEnvironment;
     this.a2jAuthorBuisnessLogic       = a2jAuthorBuisnessLogic;
     this.adminSettings                = adminSettings;
     this.topicsResourcesBusinessLogic = topicsResourcesBusinessLogic;
 }
        public ShareBuisnessLogicTests()
        {
            dbService                     = Substitute.For <IBackendDatabaseService>();
            dbSettings                    = Substitute.For <ICosmosDbSettings>();
            dynamicQueries                = Substitute.For <IDynamicQueries>();
            dbShareSettings               = Substitute.For <IShareSettings>();
            userProfileBusinessLogic      = Substitute.For <IUserProfileBusinessLogic>();
            personalizedPlanBusinessLogic = Substitute.For <IPersonalizedPlanBusinessLogic>();
            shareBusinessLogic            = new ShareBusinessLogic(dynamicQueries, dbSettings, dbService, dbShareSettings, userProfileBusinessLogic, personalizedPlanBusinessLogic);

            dbSettings.ProfilesCollectionId.Returns("UserProfile");
            dbSettings.UserResourcesCollectionId.Returns("UserResource");
            dbShareSettings.PermaLinkMaxLength.Returns(7);
        }
 public AdminBusinessLogicTests()
 {
     dynamicQueries               = Substitute.For <IDynamicQueries>();
     cosmosDbSettings             = Substitute.For <ICosmosDbSettings>();
     dbService                    = Substitute.For <IBackendDatabaseService>();
     hostingEnvironment           = Substitute.For <IHostingEnvironment>();
     a2jAuthorBuisnessLogic       = Substitute.For <ICuratedExperienceConvertor>();
     adminSettings                = Substitute.For <IAdminSettings>();
     topicsResourcesBusinessLogic = Substitute.For <ITopicsResourcesBusinessLogic>();
     adminBusiness                = new AdminBusinessLogic(dynamicQueries, cosmosDbSettings, dbService, hostingEnvironment, a2jAuthorBuisnessLogic, adminSettings, topicsResourcesBusinessLogic);
     cosmosDbSettings.CuratedExperiencesCollectionId.Returns("CuratedExperiences");
     cosmosDbSettings.GuidedAssistantAnswersCollectionId.Returns("GuidedAssistantAnswers");
     cosmosDbSettings.A2JAuthorDocsCollectionId.Returns("A2JAuthorDocs");
 }
 public PersonalizedPlanBussinessLogicTests()
 {
     dbService                = Substitute.For <IBackendDatabaseService>();
     dbSettings               = Substitute.For <ICosmosDbSettings>();
     dynamicQueries           = Substitute.For <IDynamicQueries>();
     userProfileBusinessLogic = Substitute.For <IUserProfileBusinessLogic>();
     personalizedPlanBusinessLogicSettings        = Substitute.For <IPersonalizedPlanBusinessLogic>();
     topicsResourcesBusinessLogic                 = Substitute.For <ITopicsResourcesBusinessLogic>();
     personalizedPlanBusinessLogic                = new PersonalizedPlanBusinessLogic(dbSettings, dbService, dynamicQueries, userProfileBusinessLogic, personalizedPlanEngine, personalizedPlanViewModelMapper);
     personalizedPlanBusinessLogicViewModelMapper = new PersonalizedPlanViewModelMapper(dbSettings, dynamicQueries, topicsResourcesBusinessLogic, dbService);
     dbSettings.ActionPlansCollectionId.Returns("ActionPlans");
     dbSettings.A2JAuthorDocsCollectionId.Returns("A2JAuthorDocs");
     dbSettings.GuidedAssistantAnswersCollectionId.Returns("GuidedAssistantAnswers");
     dbSettings.ProfilesCollectionId.Returns("Profiles");
     dbSettings.ResourcesCollectionId.Returns("Resources");
 }
Exemple #16
0
        public OnboardingInfoBusinessLogicTests()
        {
            httpClientService      = Substitute.For <IHttpClientService>();
            onboardingInfoSettings = Substitute.For <IOnboardingInfoSettings>();
            dynamicQueries         = Substitute.For <IDynamicQueries>();
            dbSettings             = Substitute.For <ICosmosDbSettings>();
            dynamicQueries         = Substitute.For <IDynamicQueries>();
            onboardingInfo         = new OnboardingInfoBusinessLogic(httpClientService, onboardingInfoSettings, dynamicQueries, dbSettings);

            onboardingInfoSettings.HostAddress.Returns("http://smtpservice");
            onboardingInfoSettings.PortNumber.Returns("467");
            onboardingInfoSettings.UserName.Returns("Test");
            onboardingInfoSettings.Password.Returns("Test");
            onboardingInfoSettings.FromAddress.Returns("*****@*****.**");
            onboardingInfoSettings.FallbackToAddress.Returns("*****@*****.**");
            onboardingInfoSettings.Subject.Returns("Test Mail");
            onboardingInfoSettings.FallbackBodyMessage.Returns("Test Mail Body");
        }
Exemple #17
0
 public CosmosDbDynmaicQueriesTests()
 {
     cosmosDbService = Substitute.For <IBackendDatabaseService>();
     dynamicQueries  = new CosmosDbDynamicQueries(cosmosDbService);
 }
 public TopicsResourcesBusinessLogic(IDynamicQueries dynamicQueries, ICosmosDbSettings cosmosDbSettings, IBackendDatabaseService backendDatabaseService)
 {
     dbClient   = dynamicQueries;
     dbSettings = cosmosDbSettings;
     dbService  = backendDatabaseService;
 }
Exemple #19
0
 public CosmosDbExceptionHandlingTests()
 {
     cosmosDbService = Substitute.For <IBackendDatabaseService>();
     dynamicQueries  = new CosmosDbDynamicQueries(cosmosDbService);
 }