-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supports naming conventions for tables, views, indexes, primary keys,…
… and foreign keys.
- Loading branch information
Showing
51 changed files
with
372 additions
and
880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 0 additions & 93 deletions
93
EfCore.NamingConverter.Tests/CamelCaseNamingPolicyTests.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
EfCore.NamingConverter.Tests/Conventions/ColumnNameConventionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EfCore.NamingConverter.Tests.Conventions | ||
{ | ||
public class ColumnNameConventionTest | ||
{ | ||
// TODO: The test is not implemented yet | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
EfCore.NamingConverter.Tests/Conventions/ForeignKeyNameConventionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EfCore.NamingConverter.Tests.Conventions | ||
{ | ||
public class ForeignKeyNameConventionTest | ||
{ | ||
// TODO:The test is not implemented yet | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
EfCore.NamingConverter.Tests/Conventions/IndexNameConventionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EfCore.NamingConverter.Tests.Conventions | ||
{ | ||
public class IndexNameConventionTest | ||
{ | ||
// TDDO: The test is not implemented yet | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
EfCore.NamingConverter.Tests/Conventions/KeyNameConventionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EfCore.NamingConverter.Tests.Conventions | ||
{ | ||
public class KeyNameConventionTest | ||
{ | ||
// TODO:The test is not implemented yet | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
EfCore.NamingConverter.Tests/Conventions/TableNameConventionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EfCore.NamingConverter.Tests.Conventions | ||
{ | ||
public class TableNameConventionTest | ||
{ | ||
// TODO:The test is not implemented yet | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
EfCore.NamingConverter.Tests/Conventions/ViewNameConventionTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EfCore.NamingConverter.Tests.Conventions | ||
{ | ||
public class ViewNameConventionTest | ||
{ | ||
// TODO:The test is not implemented yet | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
EfCore.NamingConverter.Tests/Converters/CamelCaseConverterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using EfCore.NamingConverter.Converters; | ||
|
||
namespace EfCore.NamingConverter.Tests.Converters | ||
{ | ||
public class CamelCaseConverterTest | ||
{ | ||
[Fact] | ||
public void CanConvertNameToCamelCase() | ||
{ | ||
var converter = new CamelCaseConverter(); | ||
|
||
Assert.Equal("camelCaseName", converter.ConvertName("CamelCaseName")); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
EfCore.NamingConverter.Tests/Converters/KebabCaseLowerConverterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using EfCore.NamingConverter.Converters; | ||
|
||
namespace EfCore.NamingConverter.Tests.Converters | ||
{ | ||
public class KebabCaseLowerConverterTest | ||
{ | ||
[Fact] | ||
public void CanConvertNameToKebabCaseLower() | ||
{ | ||
var converter = new KebabCaseLowerConverter(); | ||
|
||
Assert.Equal("kebab-case-lower", converter.ConvertName("KebabCaseLower")); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
EfCore.NamingConverter.Tests/Converters/KebabCaseUpperConverterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using EfCore.NamingConverter.Converters; | ||
|
||
namespace EfCore.NamingConverter.Tests.Converters | ||
{ | ||
public class KebabCaseUpperConverterTest | ||
{ | ||
[Fact] | ||
public void CanConvertNameToKebabCaseUpper() | ||
{ | ||
var converter = new KebabCaseUpperConverter(); | ||
|
||
Assert.Equal("SNAKE-CASE-LOWER", converter.ConvertName("SnakeCaseLower")); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
EfCore.NamingConverter.Tests/Converters/NameConverterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using EfCore.NamingConverter.Converters; | ||
|
||
namespace EfCore.NamingConverter.Tests.Converters | ||
{ | ||
public class NameConverterTest | ||
{ | ||
[Theory] | ||
[InlineData(NamingPolicy.CamelCase, "FullName", "fullName")] | ||
[InlineData(NamingPolicy.SnakeCaseLower, "FullName", "full_name")] | ||
[InlineData(NamingPolicy.SnakeCaseUpper, "FullName", "FULL_NAME")] | ||
[InlineData(NamingPolicy.KebabCaseLower, "FullName", "full-name")] | ||
[InlineData(NamingPolicy.KebabCaseUpper, "FullName", "FULL-NAME")] | ||
[InlineData(NamingPolicy.Unspecified, "FullName", "FullName")] | ||
public void CanConvertName(NamingPolicy namingPolicy, string input, string expected) | ||
{ | ||
var converter = NameConverter.From(namingPolicy); | ||
Assert.Equal(expected, converter.ConvertName(input)); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
EfCore.NamingConverter.Tests/Converters/SeparatorConverterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using EfCore.NamingConverter.Converters; | ||
|
||
namespace EfCore.NamingConverter.Tests.Converters | ||
{ | ||
public class SeparatorConverterTest | ||
{ | ||
class MySeparatorConverter : SeparatorConverter | ||
{ | ||
public MySeparatorConverter() : base(lowercase: true, separator: '_') | ||
{ | ||
} | ||
} | ||
|
||
[Fact] | ||
public void CanConvertNameToSnakeCaseLower() | ||
{ | ||
var converter = new MySeparatorConverter(); | ||
Assert.Equal("snake_case_lower", converter.ConvertName("SnakeCaseLower")); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
EfCore.NamingConverter.Tests/Converters/SnakeCaseLowerConverterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using EfCore.NamingConverter.Converters; | ||
|
||
namespace EfCore.NamingConverter.Tests.Converters | ||
{ | ||
public class SnakeCaseLowerConverterTest | ||
{ | ||
[Fact] | ||
public void CanConvertNameToSnakeCaseLower() | ||
{ | ||
var converter = new SnakeCaseLowerConverter(); | ||
Assert.Equal("snake_case_lower", converter.ConvertName("SnakeCaseLower")); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
EfCore.NamingConverter.Tests/Converters/SnakeCaseUpperConverterTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using EfCore.NamingConverter.Converters; | ||
|
||
namespace EfCore.NamingConverter.Tests.Converters | ||
{ | ||
public class SnakeCaseUpperConverterTest | ||
{ | ||
[Fact] | ||
public void CanConvertNameToSnakeCaseUpper() | ||
{ | ||
var converter = new SnakeCaseUpperConverter(); | ||
|
||
Assert.Equal("SNAKE_CASE_NAME", converter.ConvertName("SnakeCaseName")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EfCore.NamingConverter.Tests | ||
{ | ||
public class ExtensionsTest | ||
{ | ||
// TODO:The test is not implemented yet | ||
} | ||
} |
Oops, something went wrong.