mirror of
https://github.com/fergalmoran/EFCore.NamingConventions.git
synced 2025-12-27 20:18:04 +00:00
Add test for #84
This commit is contained in:
@@ -75,7 +75,15 @@ namespace EFCore.NamingConventions.Test
|
|||||||
public void Primary_key()
|
public void Primary_key()
|
||||||
{
|
{
|
||||||
var entityType = BuildEntityType(b => b.Entity<SampleEntity>());
|
var entityType = BuildEntityType(b => b.Entity<SampleEntity>());
|
||||||
Assert.Equal("pk_sample_entity", entityType.GetKeys().Single(k => k.IsPrimaryKey()).GetName());
|
Assert.Equal("pk_sample_entity", entityType.FindPrimaryKey()!.GetName());
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Primary_key_on_table_with_explicit_name()
|
||||||
|
{
|
||||||
|
var entityType = BuildEntityType(b => b.Entity<SampleEntity>().ToTable("some_explicit_name"));
|
||||||
|
|
||||||
|
Assert.Equal("pk_some_explicit_name", entityType.FindPrimaryKey()!.GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
Reference in New Issue
Block a user