public void GetTableName_returns_current_TableName() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); Assert.Equal(null, entityTypeConfiguration.GetTableName()); entityTypeConfiguration.ToTable("Foo"); Assert.Equal("Foo", entityTypeConfiguration.GetTableName().Name); }
public void Can_get_and_set_table_name() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); entityTypeConfiguration.ToTable("Foo"); Assert.Equal("Foo", entityTypeConfiguration.GetTableName().Name); }
public void ToTable_overwrites_existing_name() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); entityTypeConfiguration.ToTable("Foo"); entityTypeConfiguration.ToTable("Bar"); Assert.Equal("Bar", entityTypeConfiguration.GetTableName().Name); }
public void Apply_should_set_table_name() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); new TableAttributeConvention.TableAttributeConventionImpl() .Apply(new MockType(), entityTypeConfiguration, new TableAttribute("Foo")); Assert.Equal("Foo", entityTypeConfiguration.GetTableName().Name); }
public void Apply_should_not_set_table_name_when_already_set() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); entityTypeConfiguration.ToTable("Bar"); new TableAttributeConvention() .Apply(new MockType(), entityTypeConfiguration, new TableAttribute("Foo")); Assert.Equal("Bar", entityTypeConfiguration.GetTableName().Name); }
public void Apply_should_set_schema_name() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); new TableAttributeConvention() .Apply( new ConventionTypeConfiguration(new MockType(), () => entityTypeConfiguration, new ModelConfiguration()), new TableAttribute("Foo") { Schema = "Bar" }); Assert.Equal("Bar", entityTypeConfiguration.GetTableName().Schema); }
public void ToTable_overwrites_existing_name() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); entityTypeConfiguration.ToTable("Foo"); entityTypeConfiguration.ToTable("Bar"); Assert.Equal("Bar", entityTypeConfiguration.GetTableName().Name); }
public void GetTableName_returns_current_TableName() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); Assert.Equal(null, entityTypeConfiguration.GetTableName()); entityTypeConfiguration.ToTable("Foo"); Assert.Equal("Foo", entityTypeConfiguration.GetTableName().Name); }
public void Can_get_and_set_table_name() { var entityTypeConfiguration = new EntityTypeConfiguration(typeof(object)); entityTypeConfiguration.ToTable("Foo"); Assert.Equal("Foo", entityTypeConfiguration.GetTableName().Name); }