mirror of
https://github.com/fergalmoran/EFCore.NamingConventions.git
synced 2025-12-22 09:38:21 +00:00
29 lines
946 B
C#
29 lines
946 B
C#
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Xunit;
|
|
|
|
namespace EFCore.Naming.Test
|
|
{
|
|
public class UpperCaseNamingTest : RewriterTestBase
|
|
{
|
|
[Fact]
|
|
public void Table_name_is_rewritten()
|
|
{
|
|
using var context = CreateContext();
|
|
var entityType = context.Model.FindEntityType(typeof(SimpleBlog));
|
|
Assert.Equal("SIMPLEBLOG", entityType.GetTableName());
|
|
}
|
|
|
|
[Fact]
|
|
public void Column_name_is_rewritten()
|
|
{
|
|
using var context = CreateContext();
|
|
var entityType = context.Model.FindEntityType(typeof(SimpleBlog));
|
|
Assert.Equal("ID", entityType.FindProperty("Id").GetColumnName());
|
|
Assert.Equal("FULLNAME", entityType.FindProperty("FullName").GetColumnName());
|
|
}
|
|
|
|
TestContext CreateContext() => new TestContext(NamingConventionsExtensions.UseUpperCaseNamingConvention);
|
|
}
|
|
}
|