Esempio n. 1
0
        public SqlAzureFixture()
        {
            SqlServerTestStore.GetOrCreateShared(
                "adventureworks",
                () => SqlServerTestStore.ExecuteScript("adventureworks", "SqlAzure/adventureworks.sql"),
                cleanDatabase: false);

            Services = new ServiceCollection()
                       .AddEntityFrameworkSqlServer()
                       .AddSingleton <ILoggerFactory>(new TestSqlLoggerFactory()).BuildServiceProvider();

            Options = new DbContextOptionsBuilder()
                      .UseInternalServiceProvider(Services)
                      .EnableSensitiveDataLogging()
                      .UseSqlServer(SqlServerTestStore.CreateConnectionString("adventureworks"), b => b.ApplyConfiguration()).Options;
        }
Esempio n. 2
0
        public SqlAzureFixture()
        {
            SqlServerTestStore.GetOrCreateShared(
                "adventureworks",
                () => SqlServerTestStore.ExecuteScript(
                    "adventureworks",
                    Path.Combine(
                        Path.GetDirectoryName(typeof(SqlAzureFixture).GetTypeInfo().Assembly.Location),
                        "SqlAzure",
                        "adventureworks.sql")),
                cleanDatabase: false);

            Services = new ServiceCollection()
                       .AddEntityFrameworkSqlServer()
                       .AddSingleton <ILoggerFactory>(TestSqlLoggerFactory).BuildServiceProvider();

            Options = new DbContextOptionsBuilder()
                      .UseInternalServiceProvider(Services)
                      .EnableSensitiveDataLogging()
                      .UseSqlServer(SqlServerTestStore.CreateConnectionString("adventureworks"), b => b.ApplyConfiguration()).Options;
        }
Esempio n. 3
0
 public static SqlServerTestStore GetSharedStore()
 => SqlServerTestStore.GetOrCreateShared(
     DatabaseName,
     () => SqlServerTestStore.ExecuteScript(DatabaseName, @"Northwind.sql"),
     cleanDatabase: false);
 public SqlServerE2EFixture()
 {
     _testStore = SqlServerTestStore.GetOrCreateShared(
         "SqlServerReverseEngineerTestE2E",
         () => SqlServerTestStore.ExecuteScript("SqlServerReverseEngineerTestE2E", "ReverseEngineering/E2E.sql"));
 }