Exemple #1
0
        protected RepositoryTests(DatabaseFixture fixture)
        {
            var webHost = WebHost.CreateDefaultBuilder()
                          .UseEnvironment("SapIntegrationTesting")
                          .UseStartup <Startup>()
                          .Build();

            var configuration = (IConfiguration)webHost.Services.GetService(typeof(IConfiguration));
            var settings      = new TestSettings();

            configuration.Bind(nameof(TestSettings), settings);
            var sapServerSettings = new SapServerSettings();

            configuration.Bind(nameof(SapServerSettings), sapServerSettings);
            fixture.SetBackupPath(settings.SqlBackupPath);

            DalService = (IDalService)webHost.Services.GetService(typeof(IDalService));

            //Clear tests after dispose
            fixture.SetConnectionString(sapServerSettings.SapServerSql);
            fixture.BackupDatabase();
            fixture.RestoreDatabaseOnDispose(true);
        }
Exemple #2
0
 public BusinessPartnerRepositoryTests(DatabaseFixture fixture) : base(fixture)
 {
     _customerBeforeTesting = DalService.CreateUnitOfWork().BusinessPartners.GetAllAsync(
         PageRequest.Of(0, int.MaxValue, Sort <BusinessPartner> .By(x => x.Name)))
                              .Result.Select(c => c.Key).ToList();
 }
Exemple #3
0
 public QuotationRepositoryTests(DatabaseFixture fixture) : base(fixture)
 {
 }
Exemple #4
0
 public EmployeesRepositoryTests(DatabaseFixture fixture) : base(fixture)
 {
 }
 public CompanyRepositoryTests(DatabaseFixture fixture) : base(fixture)
 {
 }