public LotosWholesalePriceUpdater(
     LotosWholesalePriceFetcher fetcher,
     SystemFranchiseCollection franchiseCollection,
     GasWebDbContext dbContext)
     : base(fetcher, dbContext, franchiseCollection.Lotos)
 {
 }
 public OrlenWholesalePriceUpdater(
     OrlenWholesalePriceFetcher fetcher,
     GasWebDbContext dbContext,
     SystemFranchiseCollection franchiseCollection)
     : base(fetcher, dbContext, franchiseCollection.Orlen)
 {
 }
 public BpWholesalePriceUpdater(
     BpWholesalePriceFetcher priceProvider,
     GasWebDbContext dbContext,
     SystemFranchiseCollection franchiseCollection)
     : base(priceProvider, dbContext, franchiseCollection.Bp)
 {
 }
Example #4
0
 public WholesalePriceUpdater(
     IWholesalePriceProvider priceProvider,
     GasWebDbContext dbContext,
     long franchiseId)
 {
     this.priceProvider = priceProvider;
     this.dbContext     = dbContext;
     this.franchiseId   = franchiseId;
 }
 public PriceSubmissionsService(
     GasWebDbContext dbContext,
     IAuditMetadataProvider auditMetadataProvider,
     UserContext userContext)
 {
     this.dbContext             = dbContext;
     this.auditMetadataProvider = auditMetadataProvider;
     this.userContext           = userContext;
 }
Example #6
0
 public AuchanGasStationsUpdater(
     AuchanGasStationsFetcher gasStationsFetcher,
     SystemFranchiseCollection franchiseCollection,
     GasWebDbContext dbContext,
     IAuditMetadataProvider auditMetadataProvider)
 {
     this.gasStationsFetcher    = gasStationsFetcher;
     this.franchiseCollection   = franchiseCollection;
     this.dbContext             = dbContext;
     this.auditMetadataProvider = auditMetadataProvider;
 }
Example #7
0
 public FranchiseSeeder(
     GasWebDbContext dbContext,
     SystemFranchiseCollectionFactory franchiseCollectionFactory,
     ILogger <FranchiseSeeder> logger,
     IAuditMetadataProvider auditMetadataProvider)
 {
     this.dbContext = dbContext;
     this.franchiseCollectionFactory = franchiseCollectionFactory;
     this.logger = logger;
     this.auditMetadataProvider = auditMetadataProvider;
 }
Example #8
0
 public SchedulerSeeder(
     ILogger <SchedulerSeeder> logger,
     GasWebDbContext dbContext,
     Func <SystemFranchiseCollection> franchiseCollectionFactory,
     IAuditMetadataProvider auditMetadataProvider)
 {
     this.logger    = logger;
     this.dbContext = dbContext;
     this.franchiseCollectionFactory = franchiseCollectionFactory;
     this.auditMetadataProvider      = auditMetadataProvider;
 }
Example #9
0
 public SchedulerService(
     GasWebDbContext dbContext,
     IAuditMetadataProvider auditMetadataProvider,
     SchedulerTaskDispatcher taskDispatcher,
     UserContext userContext)
 {
     this.dbContext             = dbContext;
     this.auditMetadataProvider = auditMetadataProvider;
     this.taskDispatcher        = taskDispatcher;
     this.userContext           = userContext;
 }
Example #10
0
        public async Task InitializeAsync()
        {
            var projectDir = Directory.GetCurrentDirectory();
            var configPath = Path.Combine(projectDir, "appsettings.json");

            webHost = WebHost.CreateDefaultBuilder()
                      .UseStartup <Startup>()
                      .UseSetting("URLS", "http://localhost:60841")
                      .ConfigureTestServices(services =>
            {
                services.AddScoped <IFacebookAuthenticator, FacebookAuthenticatorMock>();
            })
                      .ConfigureAppConfiguration(app =>
            {
                app.AddJsonFile(configPath);
            })
                      .Build();

            var postgreSqlSettings = webHost.Services.GetRequiredService <PostgreSqlSettings>();

            dbContextOptions = new DbContextOptionsBuilder <GasWebDbContext>().UseNpgsql(postgreSqlSettings.ConnectionString).Options;

            using (var dbContext = new GasWebDbContext(dbContextOptions))
            {
                await dbContext.Database.EnsureDeletedAsync();

                dbContext.Database.Migrate();
            }

            webHostTask = webHost.RunAsync(webHostCancellationTokenSource.Token);

            var httpHandler = new HttpClientHandler
            {
                CookieContainer = new CookieContainer()
            };

            HttpClient = new HttpClient(httpHandler)
            {
                BaseAddress = new Uri("http://localhost:60841/")
            };

            await CreateUserAndAuthenticate();
        }
Example #11
0
 public UserService(GasWebDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Example #12
0
 public SystemUserSeeder(GasWebDbContext dbContext, ILogger <SystemUserSeeder> logger)
 {
     this.dbContext = dbContext;
     this.logger    = logger;
 }
Example #13
0
 public FranchiseService(GasWebDbContext dbContext, IAuditMetadataProvider auditMetadataProvider)
 {
     this.dbContext             = dbContext;
     this.auditMetadataProvider = auditMetadataProvider;
 }
Example #14
0
 public GasStationService(GasWebDbContext dbContext, IAuditMetadataProvider auditMetadataProvider)
 {
     this.dbContext             = dbContext;
     this.auditMetadataProvider = auditMetadataProvider;
 }
Example #15
0
 public DashboardService(GasWebDbContext dbContext)
 {
     this.dbContext = dbContext;
 }