@@ -28,55 +28,42 @@ protected ProductContext GetContext(EnumLookupOptions? enumLookupOptions = null,
2828 return context ;
2929 }
3030
31- #if NET5_0_OR_GREATER
3231 [ Fact ]
3332 public void OverrideColumnNaming ( )
3433 {
3534 ProductContext context = GetContext ( namingOptions : new NamingOptions ( ) . OverrideColumnNaming ( NamingScheme . SnakeCase ) ) ;
3635
3736 IEntityType findEntityType = context . Model . FindEntityType ( typeof ( ProductTag ) ) ;
38-
37+ #if NET5_0_OR_GREATER
3938 Assert . Equal ( "product_tag_id" , findEntityType . FindProperty ( nameof ( ProductTag . ProductTagId ) ) . GetColumnBaseName ( ) ) ;
40- }
4139#else
42- [ Fact ]
43- public void OverrideColumnNaming ( )
44- {
45- ProductContext context = GetContext ( namingOptions : new NamingOptions ( ) . OverrideColumnNaming ( NamingScheme . SnakeCase ) ) ;
46-
47- IEntityType findEntityType = context . Model . FindEntityType ( typeof ( ProductTag ) ) ;
48-
4940 Assert . Equal ( "product_tag_id" , findEntityType . FindProperty ( nameof ( ProductTag . ProductTagId ) ) . GetColumnName ( ) ) ;
50- }
5141#endif
42+ }
5243
53- #if NET5_0_OR_GREATER
5444 [ Fact ]
5545 public void OverrideConstraintNaming ( )
5646 {
5747 ProductContext context = GetContext ( namingOptions : new NamingOptions ( ) . OverrideConstraintNaming ( NamingScheme . SnakeCase ) ) ;
5848
5949 IEntityType findEntityType = context . Model . FindEntityType ( typeof ( ProductTag ) ) ;
6050 Assert . Equal ( "ProductTag" , findEntityType . GetTableName ( ) ) ;
51+
52+ #if NET5_0_OR_GREATER
6153 Assert . Equal ( "ProductTagId" , findEntityType . FindProperty ( nameof ( ProductTag . ProductTagId ) ) . GetColumnBaseName ( ) ) ;
62- Assert . True ( findEntityType . GetKeys ( ) . All ( x => x . GetName ( ) == NamingScheme . SnakeCase ( x . GetDefaultName ( ) ) ) ) ;
63- Assert . True ( findEntityType . GetForeignKeys ( ) . All ( x => x . GetConstraintName ( ) == NamingScheme . SnakeCase ( x . GetDefaultName ( ) ) ) ) ;
64- Assert . True ( findEntityType . GetIndexes ( ) . All ( x => x . GetDatabaseName ( ) == NamingScheme . SnakeCase ( x . GetDefaultDatabaseName ( ) ) ) ) ;
65- }
6654#else
67- [ Fact ]
68- public void OverrideConstraintNaming ( )
69- {
70- ProductContext context = GetContext ( namingOptions : new NamingOptions ( ) . OverrideConstraintNaming ( NamingScheme . SnakeCase ) ) ;
71-
72- IEntityType findEntityType = context . Model . FindEntityType ( typeof ( ProductTag ) ) ;
73- Assert . Equal ( "ProductTag" , findEntityType . GetTableName ( ) ) ;
7455 Assert . Equal ( "ProductTagId" , findEntityType . FindProperty ( nameof ( ProductTag . ProductTagId ) ) . GetColumnName ( ) ) ;
56+ #endif
57+
7558 Assert . True ( findEntityType . GetKeys ( ) . All ( x => x . GetName ( ) == NamingScheme . SnakeCase ( x . GetDefaultName ( ) ) ) ) ;
7659 Assert . True ( findEntityType . GetForeignKeys ( ) . All ( x => x . GetConstraintName ( ) == NamingScheme . SnakeCase ( x . GetDefaultName ( ) ) ) ) ;
60+
61+ #if NET5_0_OR_GREATER
62+ Assert . True ( findEntityType . GetIndexes ( ) . All ( x => x . GetDatabaseName ( ) == NamingScheme . SnakeCase ( x . GetDefaultDatabaseName ( ) ) ) ) ;
63+ #else
7764 Assert . True ( findEntityType . GetIndexes ( ) . All ( x => x . GetName ( ) == NamingScheme . SnakeCase ( x . GetDefaultName ( ) ) ) ) ;
78- }
7965#endif
66+ }
8067
8168 [ Fact ]
8269 public void OverrideTableNaming ( )
0 commit comments