예제 #1
0
        public void CreateDbContextWhenGoodMySql()
        {
            var testDbContext = EntityFrameworkTools <MySqlDbContext> .CreateDbContext("", DEVELOPMENT_ENVIRONMENT);

            testDbContext.ShouldNotBeNull();
            testDbContext.Cities.ShouldNotBeNull();
            testDbContext.Countries.ShouldNotBeNull();
        }
예제 #2
0
        public void CreateDbContextWhenGoodMySqlInGenericSettingsFile()
        {
            var testDbContext = EntityFrameworkTools <MySqlDbContext> .CreateDbContext();

            testDbContext.ShouldNotBeNull();
            testDbContext.Cities.ShouldNotBeNull();
            testDbContext.Countries.ShouldNotBeNull();
        }
예제 #3
0
        public void CreateDbContextWhenRepositoryAndConnectionStringWithAdminPrefixAreGoodInSettingsFile()
        {
            var testDbContext = EntityFrameworkTools <GoodDbContext_Development> .CreateDbContext("Admin_", DEVELOPMENT_ENVIRONMENT);

            testDbContext.ShouldNotBeNull();
            testDbContext.Cities.ShouldNotBeNull();
            testDbContext.Countries.ShouldNotBeNull();
        }
예제 #4
0
        public void CreateDbContextWhenOtherGoodEnvironmentAndSettingsFileExist()
        {
            var testDbContext = EntityFrameworkTools <GoodDbContext_Staging> .CreateDbContext("", STAGING_ENVIRONMENT);

            testDbContext.ShouldNotBeNull();
            testDbContext.Cities.ShouldNotBeNull();
            testDbContext.Countries.ShouldNotBeNull();
        }
예제 #5
0
 public GoodDbContext_Development CreateDbContext(string[] args) => EntityFrameworkTools <GoodDbContext_Development> .CreateDbContext();
예제 #6
0
 public GoodDbContext_Staging CreateDbContext(string[] args) => EntityFrameworkTools <GoodDbContext_Staging> .CreateDbContext();
예제 #7
0
 public void ThrowWhenRepositoryPrefixAreBadInSettingsFile()
 {
     Should.Throw <ConnectionStringException>(() => EntityFrameworkTools <GoodDbContext_Development> .CreateDbContext("BadPrefix_", DEVELOPMENT_ENVIRONMENT));
 }
예제 #8
0
 public void ThrowConnectionStringException()
 {
     Should.Throw <ConnectionStringException>(() => EntityFrameworkTools <NoConnectionStringForThisDbContext> .CreateDbContext("", DEVELOPMENT_ENVIRONMENT));
 }
예제 #9
0
 public void ThrowRepositoryProviderExceptionWhenRepositoryAreBadInSettingsFile()
 {
     Should.Throw <RepositoryProviderException>(() => EntityFrameworkTools <BadProviderDbContext> .CreateDbContext("", DEVELOPMENT_ENVIRONMENT));
 }
예제 #10
0
 public void ThrowConnectionStringExceptionWhenEnvironmentIsBad()
 {
     Should.Throw <FileNotFoundException>(() => EntityFrameworkTools <GoodDbContextBase> .CreateDbContext("", "UnknowEnvironement"));
 }
예제 #11
0
 public void ThrowConnectionStringExceptionWhenInMemory()
 {
     Should.Throw <ConnectionStringException>(() => EntityFrameworkTools <InMemoryDbContext> .CreateDbContext("", DEVELOPMENT_ENVIRONMENT));
 }