public BaseApiTest()
        {
            // Arrange test enviromnent
            var builder = new WebHostBuilder();

            builder.ConfigureAppConfiguration((hostingContext, config) =>
            {
                config.SetBasePath(Directory.GetCurrentDirectory());
                config.AddJsonFile("config/appsettings.json", optional: true, reloadOnChange: true);
                config.AddJsonFile(
                    $"config/appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json",
                    optional: true);
                config.AddEnvironmentVariables();
            })
            .UseStartup <Startup>();

            // Load environment variables
            LoadEnvironmentVariables();

            // Start test server
            TestServer testServer = new TestServer(builder);

            _apiClient = testServer.CreateClient();

            // Set services
            _testService    = testServer.Services.GetService <ITestService>();
            _infrastructure = testServer.Services.GetService <IInfrastructureService>();

            // Crate fake HttpContext
            CreateDefaultHttpContext();
        }
Esempio n. 2
0
 public ReservationService(IUnitOfWork unitOfWork, IInfrastructureService infrastructureService)
 {
     _unitOfWork            = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
     _infrastructureService = infrastructureService ?? throw new ArgumentNullException(nameof(infrastructureService));
     _validationRules       = new List <ISeatValidation>();
     UseDefaultRules();
 }
 public DeleteCategoryHandler(IExtendedCategoryService extendedCategoryService, ILocalizationService localizationService, IInfrastructureService infrastructureService, ICustomerService customerService)
 {
     _extendedCategoryService = extendedCategoryService;
     _localizationService     = localizationService;
     _infrastructureService   = infrastructureService;
     _customerService         = customerService;
 }
 public ApiControllerBase(IInfrastructureService infrastructure)
 {
     Configuration = infrastructure.Configuration;
     LogEngine     = infrastructure.LogEngine;
     Localizer     = infrastructure.Localizer;
     Mapper        = infrastructure.Mapper;
 }
Esempio n. 5
0
 public RecoveryPasswordHandler(IWorkflowMessageService workflowService,
                                ICustomerService customerService,
                                IInfrastructureService infrastructureService)
 {
     _workflowService       = workflowService;
     _customerService       = customerService;
     _infrastructureService = infrastructureService;
 }
Esempio n. 6
0
        public AdminController(IUnitOfWorkInt unitOfWork, IMedDraService meddraService, IInfrastructureService infrastuctureService)
        {
            Check.IsNotNull(meddraService, "meddraService may not be null");

            _unitOfWork           = unitOfWork;
            _meddraService        = meddraService;
            _infrastuctureService = infrastuctureService;
        }
Esempio n. 7
0
        //protected readonly PublicApiConfiguration PublicApiConfiguration;

        public ServiceBase(IInfrastructureService infrastructure, IHttpContextAccessor httpContextAccessor, IHttpClientFactory httpClientFactory)
        {
            Configuration       = infrastructure.Configuration;
            LogEngine           = infrastructure.LogEngine;
            Mapper              = infrastructure.Mapper;
            HttpContextAccessor = httpContextAccessor;
            //PublicApiConfiguration = infrastructure.OptionsPublicApiConfiguration.Value;
            HttpClientFactory = httpClientFactory;
        }
Esempio n. 8
0
 public ServiceBase(IInfrastructureService infrastructure, IHttpContextAccessor httpContextAccessor, ApplicationDbContext db)
 {
     _configuration       = infrastructure.Configuration;
     _log                 = infrastructure.Log;
     _localizer           = infrastructure.Localizer;
     _enumsManager        = infrastructure.EnumsManager;
     _httpContextAccessor = httpContextAccessor;
     _db = db;
 }
Esempio n. 9
0
 public CausalityReportQueryHandler(
     IReportInstanceQueries reportInstanceQueries,
     IInfrastructureService infrastructureService,
     ILinkGeneratorService linkGeneratorService,
     ILogger <CausalityReportQueryHandler> logger)
 {
     _reportInstanceQueries = reportInstanceQueries ?? throw new ArgumentNullException(nameof(reportInstanceQueries));
     _infrastructureService = infrastructureService ?? throw new ArgumentNullException(nameof(infrastructureService));
     _linkGeneratorService  = linkGeneratorService ?? throw new ArgumentNullException(nameof(linkGeneratorService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public MessageTokenProviderExtended(IStoreService storeService,
                                     IUrlHelperFactory urlHelperFactory,
                                     IActionContextAccessor actionContextAccessor,
                                     IGenericAttributeService genericAttributeService,
                                     StoreInformationSettings storeInformationSettings,
                                     IInfrastructureService infrastructureService)
     : base(storeService,
            urlHelperFactory,
            actionContextAccessor,
            genericAttributeService,
            storeInformationSettings)
 {
     _infraService = infrastructureService;
 }
 public InfrastructureController(IInfrastructureService infrastructureService)
 {
     _infrastructureService = infrastructureService;
 }
Esempio n. 12
0
 public HomeController(ILogger <HomeController> logger, IInfrastructureService infrastructureService)
 {
     _logger = logger;
     _infrastructureService = infrastructureService;
 }
Esempio n. 13
0
 public string RegisterInfrastructureService(Guid partitionId, long replicaId, IInfrastructureService service)
 {
     return("Test");
 }
 public TestService(IInfrastructureService infrastructure, IHttpContextAccessor httpContextAccessor, ApplicationDbContext db)
     : base(infrastructure, httpContextAccessor, db)
 {
 }
Esempio n. 15
0
 public CreateAccountHandler(ICustomerRegistrationService customerRegistration, IInfrastructureService infrastructureService)
 {
     _customerRegistration  = customerRegistration;
     _infrastructureService = infrastructureService;
 }
Esempio n. 16
0
        private string RegisterInfrastructureServiceHelper(Guid partitionId, long replicaId, IInfrastructureService service)
        {
            InfrastructureServiceBroker broker = new InfrastructureServiceBroker(service);

            NativeCommon.IFabricStringResult nativeString = this.nativeAgent.RegisterInfrastructureService(
                partitionId,
                replicaId,
                broker);

            return(StringResult.FromNative(nativeString));
        }
Esempio n. 17
0
 public GetCategoriesShortInfoHandler(IExtendedCategoryService categoryService, IInfrastructureService infrastructureService)
 {
     _categoryService       = categoryService;
     _infrastructureService = infrastructureService;
 }
 internal InfrastructureServiceBroker(IInfrastructureService service)
 {
     this.service = service;
 }
Esempio n. 19
0
        public string RegisterInfrastructureService(Guid partitionId, long replicaId, IInfrastructureService service)
        {
            Requires.Argument <Guid>("partitionId", partitionId).NotNull();

            return(Utility.WrapNativeSyncInvokeInMTA(() => this.RegisterInfrastructureServiceHelper(partitionId, replicaId, service), "InfrastructureServiceAgent.RegisterInfrastructureService"));
        }
Esempio n. 20
0
        //private readonly IMongoCollection<User> UsersCollection;

        public TestController(IInfrastructureService infrastructure, IMongoClient mongoDbClient) : base(infrastructure)
        {
            MongoDbDbClient = mongoDbClient;
        }
Esempio n. 21
0
 public void OneTimeSetup()
 {
     _mockingHelper         = new MockingHelper();
     _infrastructureService = _mockingHelper.ServiceFactory.Object.CreateInfrastructureService();
 }
Esempio n. 22
0
 public string RegisterInfrastructureService(Guid partitionId, long replicaId, IInfrastructureService service)
 {
     return(agent.RegisterInfrastructureService(partitionId, replicaId, service));
 }
Esempio n. 23
0
        public string RegisterInfrastructureService(Guid partitionId, long replicaId, IInfrastructureService service)
        {
            if (RegisterInfrastructureServiceFunc != null)
            {
                return(RegisterInfrastructureServiceFunc(partitionId, replicaId, service));
            }

            string registrationId = string.Format(CultureInfo.InvariantCulture, "P{0}_R{1}", partitionId, replicaId);

            return(registrationId);
        }
 public string RegisterInfrastructureService(Guid partitionId, long replicaId, IInfrastructureService service)
 {
     // This endpoint, returned from ChangeRole, is not used when InfrastructureService is run as a user application
     return("{0}:{1}".ToString(partitionId, replicaId));
 }