mirror of
https://github.com/fergalmoran/EFCore.NamingConventions.git
synced 2025-12-22 09:38:21 +00:00
* Specific no longer extend from an EF convention base class, but rather implement an interface (easier for testing). * The EF convention now accepts a rewriter in its ctor. * Eliminated useless duplication in the tests, we now have one test suite for the EF convention, and another suite for the various specific rewriters.
30 lines
924 B
C#
30 lines
924 B
C#
using System.Globalization;
|
|
using EFCore.NamingConventions.Internal;
|
|
using Xunit;
|
|
|
|
namespace EFCore.NamingConventions.Test
|
|
{
|
|
public class RewriterTest
|
|
{
|
|
[Fact]
|
|
public void SnakeCase()
|
|
=> Assert.Equal("full_name",
|
|
new SnakeCaseNameRewriter(CultureInfo.InvariantCulture).RewriteName("FullName"));
|
|
|
|
[Fact]
|
|
public void UpperSnakeCase()
|
|
=> Assert.Equal("FULL_NAME",
|
|
new UpperSnakeCaseNameRewriter(CultureInfo.InvariantCulture).RewriteName("FullName"));
|
|
|
|
[Fact]
|
|
public void LowerCase()
|
|
=> Assert.Equal("fullname",
|
|
new LowerCaseNameRewriter(CultureInfo.InvariantCulture).RewriteName("FullName"));
|
|
|
|
[Fact]
|
|
public void UpperCase()
|
|
=> Assert.Equal("FULLNAME",
|
|
new UpperCaseNameRewriter(CultureInfo.InvariantCulture).RewriteName("FullName"));
|
|
}
|
|
}
|