public A2JAuthorBusinessLogicTests()
 {
     dbSettings = Substitute.For<ICosmosDbSettings>();
     dbService = Substitute.For<IBackendDatabaseService>();
     personalizedPlanEngine = Substitute.For<IPersonalizedPlanEngine>();
     a2jAuthor = new A2JAuthorBusinessLogic(dbSettings, dbService, personalizedPlanEngine);
 }
Пример #2
0
        private static (Uri, Uri) CreateCosmosDbUris(ICosmosDbSettings settings)
        {
            var databaseUri   = UriFactory.CreateDatabaseUri(settings.DatabaseName);
            var collectionUri = UriFactory.CreateDocumentCollectionUri(settings.DatabaseName, settings.ContainerName);

            return(databaseUri, collectionUri);
        }
 public StateProvinceBusinessLogic(ICosmosDbSettings cosmosDbSettings, IBackendDatabaseService backendDatabaseService,
                                   IDynamicQueries dynamicQueries)
 {
     dbSettings = cosmosDbSettings;
     dbService  = backendDatabaseService;
     dbClient   = dynamicQueries;
 }
 public UserProfileBusinessLogic(IDynamicQueries dynamicQueries, ICosmosDbSettings cosmosDbSettings,
                                 IBackendDatabaseService backendDatabaseService)
 {
     dbClient   = dynamicQueries;
     dbSettings = cosmosDbSettings;
     dbService  = backendDatabaseService;
 }
Пример #5
0
 public A2JAuthorBusinessLogic(ICosmosDbSettings cosmosDbSettings, IBackendDatabaseService backendDatabaseService,
                               IPersonalizedPlanEngine a2JAuthorParserBusinessLogic)
 {
     dbSettings             = cosmosDbSettings;
     dbService              = backendDatabaseService;
     personalizedPlanEngine = a2JAuthorParserBusinessLogic;
 }
 public CuratedExperienceBuisnessLogic(ICosmosDbSettings cosmosDbSettings, IBackendDatabaseService backendDatabaseService,
                                       IA2JAuthorLogicParser parser)
 {
     dbSettings  = cosmosDbSettings;
     dbService   = backendDatabaseService;
     this.parser = parser;
 }
Пример #7
0
 public CosmosDbRepository(ICosmosDbSettings cosmosDbSettings)
 {
     _cosmosDbClient   = new CosmosClient(cosmosDbSettings.EndpointUrl, cosmosDbSettings.AuthorizationKey);
     _cosmosDbSettings = cosmosDbSettings;
     _database         = new Lazy <Database>(GetDatabase);
     _container        = new Lazy <Container>(GetContainer);
 }
Пример #8
0
        public CosmosDbHelper(IOptions <CosmosDbSettings> settings, DocumentClient cosmosClient)
        {
            Throw.IfNull(settings, nameof(settings));
            _client = cosmosClient;

            _settings = settings.Value;
        }
        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";
        }
Пример #10
0
 public CosmosDbCreateRequest(ICosmosDbSettings settings)
 {
     DatabaseName       = settings.DatabaseName;
     ContainerName      = settings.ContainerName;
     DatabaseThroughput = settings.DatabaseThroughput;
     PartitionKeyPath   = settings.PartitionKeyPath;
 }
Пример #11
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;
 }
Пример #13
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");
        }
Пример #14
0
 public ServiceProvidersOrchestrator(IEnumerable <IServiceProviderAdapter> serviceProviderAdaptors, IBackendDatabaseService backendDatabaseService,
                                     ICosmosDbSettings cosmosDbSettings, IHttpClientService httpClientService, IA2JSettings a2jSettings)
 {
     this.serviceProviderAdaptors = serviceProviderAdaptors;
     this.backendDatabaseService  = backendDatabaseService;
     this.cosmosDbSettings        = cosmosDbSettings;
     this.httpClientService       = httpClientService;
     this.a2jSettings             = a2jSettings;
 }
        public CuratedExperienceBuisnessLogicTests()
        {
            dbService  = Substitute.For <IBackendDatabaseService>();
            dbSettings = Substitute.For <ICosmosDbSettings>();
            parser     = Substitute.For <IA2JAuthorLogicParser>();

            curatedExperience = new CuratedExperienceBuisnessLogic(dbSettings, dbService, parser);
            dbSettings.CuratedExperiencesCollectionId.Returns("CuratedExperiences");
            dbSettings.GuidedAssistantAnswersCollectionId.Returns("GuidedAssistantAnswers");
        }
 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;
 }
Пример #17
0
 public CosmosDbRepository(ICosmosDbSettings cosmosDbSettings)
 {
     _cosmosDbSettings = cosmosDbSettings;
     _documentClient   = new DocumentClient(
         new Uri(cosmosDbSettings.EndpointUrl),
         cosmosDbSettings.AuthorizationKey,
         cosmosDbSettings.ConnectionPolicy);
     _documentClient.OpenAsync().GetAwaiter().GetResult();
     (_databaseUri, _collectionUri) = CreateCosmosDbUris(cosmosDbSettings);
 }
Пример #18
0
        public ApprenticeshipServiceWrapper(IOptions <ApprenticeshipServiceSettings> settings, ICosmosDbHelper cosmosDbHelper,
                                            IOptions <CosmosDbSettings> cosmosDbSettings,
                                            IOptions <CosmosDbCollectionSettings> cosmosDbCollectionSettings)
        {
            Throw.IfNull(settings, nameof(settings));
            _settings = settings.Value;

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings.Value;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings.Value;
        }
 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;
 }
Пример #20
0
 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;
 }
Пример #21
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 ApprenticeshipCollectionService(
            ICosmosDbHelper cosmosDbHelper,
            IOptions <CosmosDbSettings> cosmosDbSettings,
            IOptions <CosmosDbCollectionSettings> cosmosDbCollectionSettings)
        {
            Throw.IfNull(cosmosDbHelper, nameof(cosmosDbHelper));
            Throw.IfNull(cosmosDbSettings, nameof(cosmosDbSettings));
            Throw.IfNull(cosmosDbCollectionSettings, nameof(cosmosDbCollectionSettings));

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings.Value;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings.Value;
        }
 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");
 }
        public FeChoiceService(
            ICosmosDbHelper cosmosDbHelper,
            CosmosDbSettings cosmosDbSettings,
            CosmosDbCollectionSettings cosmosDbCollectionSettings)
        {
            Throw.IfNull(cosmosDbHelper, nameof(cosmosDbHelper));
            Throw.IfNull(cosmosDbSettings, nameof(cosmosDbSettings));
            Throw.IfNull(cosmosDbCollectionSettings, nameof(cosmosDbCollectionSettings));

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings;
        }
        public ApprenticeshipFrameworkService(
            ICosmosDbHelper cosmosDbHelper,
            CosmosDbSettings cosmosDbSettings,
            CosmosDbCollectionSettings cosmosDbCollectionSettings)
        {
            Throw.IfNull(cosmosDbHelper, nameof(cosmosDbHelper));
            Throw.IfNull(cosmosDbSettings, nameof(cosmosDbSettings));
            Throw.IfNull(cosmosDbCollectionSettings, nameof(cosmosDbCollectionSettings));

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings;
        }
Пример #26
0
        public SectorSubjectAreaTier1Service(
            ICosmosDbHelper cosmosDbHelper,
            CosmosDbSettings cosmosDbSettings,
            CosmosDbCollectionSettings cosmosDbCollectionSettings)
        {
            Throw.IfNull(cosmosDbHelper, nameof(cosmosDbHelper));
            Throw.IfNull(cosmosDbSettings, nameof(cosmosDbSettings));
            Throw.IfNull(cosmosDbCollectionSettings, nameof(cosmosDbCollectionSettings));

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings;
        }
        public MigrationReportCollectionService(
            ICosmosDbHelper cosmosDbHelper,
            IOptions <CosmosDbSettings> cosmosDbSettings,
            IOptions <CosmosDbCollectionSettings> cosmosDbCollectionSettings)
        {
            Throw.IfNull(cosmosDbHelper, nameof(cosmosDbHelper));
            Throw.IfNull(cosmosDbSettings, nameof(cosmosDbSettings));
            Throw.IfNull(cosmosDbCollectionSettings, nameof(cosmosDbCollectionSettings));

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings.Value;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings.Value;
        }
Пример #28
0
        public StandardSectorCodeService(
            ICosmosDbHelper cosmosDbHelper,
            CosmosDbSettings cosmosDbSettings,
            CosmosDbCollectionSettings cosmosDbCollectionSettings)
        {
            Throw.IfNull(cosmosDbHelper, nameof(cosmosDbHelper));
            Throw.IfNull(cosmosDbSettings, nameof(cosmosDbSettings));
            Throw.IfNull(cosmosDbCollectionSettings, nameof(cosmosDbCollectionSettings));

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings;
        }
Пример #29
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 VenueCollectionService(
            ICosmosDbHelper cosmosDbHelper,
            IOptions <CosmosDbSettings> cosmosDbSettings,
            IOptions <CosmosDbCollectionSettings> cosmosDbCollectionSettings)
        {
            Throw.IfNull(cosmosDbHelper, nameof(cosmosDbHelper));
            Throw.IfNull(cosmosDbSettings, nameof(cosmosDbSettings));
            Throw.IfNull(cosmosDbCollectionSettings, nameof(cosmosDbCollectionSettings));

            _cosmosDbHelper             = cosmosDbHelper;
            _cosmosDbSettings           = cosmosDbSettings.Value;
            _cosmosDbCollectionSettings = cosmosDbCollectionSettings.Value;
            _documentClient             = _cosmosDbHelper.GetClient();
        }