Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Humanizer.Tests.Shared to Humanizer.Tests #1448

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ Check out [Dutch](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer/
[Russian](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer/Localisation/NumberToWords/RussianNumberToWordsConverter.cs) localisations for examples of how you can write a Converter for your language.
You should then register your converter in the [ConverterFactory](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer/NumberToWordsExtension.cs#L13) for it to kick in on your locale.

Don't forget to write tests for your localisations. Check out the existing [DateHumanizeTests](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer.Tests.Shared/Localisation/ru-RU/DateHumanizeTests.cs), [TimeSpanHumanizeTests](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer.Tests.Shared/Localisation/ru-RU/TimeSpanHumanizeTests.cs) and [NumberToWordsTests](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer.Tests.Shared/Localisation/ru-RU/NumberToWordsTests.cs).
Don't forget to write tests for your localisations. Check out the existing [DateHumanizeTests](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer.Tests/Localisation/ru-RU/DateHumanizeTests.cs), [TimeSpanHumanizeTests](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer.Tests/Localisation/ru-RU/TimeSpanHumanizeTests.cs) and [NumberToWordsTests](https://github.com/Humanizr/Humanizer/blob/main/src/Humanizer.Tests/Localisation/ru-RU/NumberToWordsTests.cs).
248 changes: 0 additions & 248 deletions src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems

This file was deleted.

12 changes: 0 additions & 12 deletions src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.shproj

This file was deleted.

5 changes: 0 additions & 5 deletions src/Humanizer.Tests/Humanizer.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<ProjectReference Include="..\Humanizer\Humanizer.csproj" />
<Reference Include="System.ComponentModel.DataAnnotations" Condition="'$(TargetFramework)' == 'net48' "/>

<Compile Include="..\Humanizer.Tests.Shared\**\*.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>

<Content Include="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
namespace Humanizer.Tests.Localisation.el
{
[UseCulture("el")]
public class NumberToWordsTests
{
[InlineData(1, "ένα")]
[InlineData(10, "δέκα")]
[InlineData(11, "έντεκα")]
[InlineData(14, "δεκατέσσερα")]
[InlineData(20, "είκοσι")]
[InlineData(122, "εκατόν είκοσι δύο")]
[InlineData(3501, "τρείς χιλιάδες πεντακόσια ένα")]
[InlineData(100, "εκατό")]
[InlineData(1000, "χίλια")]
[InlineData(100000, "εκατό χιλιάδες")]
[InlineData(13448, "δεκατρείς χιλιάδες τετρακόσια σαράντα οκτώ")]
[InlineData(53, "πενήντα τρία")]
[InlineData(123647, "εκατόν είκοσι τρείς χιλιάδες εξακόσια σαράντα επτά")]
[InlineData(14000000, "δεκατέσσερα εκατομμύρια")]
[InlineData(578412, "πεντακόσιες εβδομήντα οκτώ χιλιάδες τετρακόσια δώδεκα")]
[InlineData(1000000000, "ένα δισεκατομμύριο")]
[InlineData(1000000001, "ένα δισεκατομμύριο ένα")]
[InlineData(1469, "χίλια τετρακόσια εξήντα εννέα")]
[InlineData(69, "εξήντα εννέα")]
[InlineData(619, "εξακόσια δεκαεννέα")]
[InlineData(1190, "χίλια εκατόν ενενήντα")]
[Theory]
public void ToWordsInt(int number, string expected) =>
Assert.Equal(expected, number.ToWords());
}
}
namespace Humanizer.Tests.Localisation.el
{
[UseCulture("el")]
public class NumberToWordsTests
{
[InlineData(1, "ένα")]
[InlineData(10, "δέκα")]
[InlineData(11, "έντεκα")]
[InlineData(14, "δεκατέσσερα")]
[InlineData(20, "είκοσι")]
[InlineData(122, "εκατόν είκοσι δύο")]
[InlineData(3501, "τρείς χιλιάδες πεντακόσια ένα")]
[InlineData(100, "εκατό")]
[InlineData(1000, "χίλια")]
[InlineData(100000, "εκατό χιλιάδες")]
[InlineData(13448, "δεκατρείς χιλιάδες τετρακόσια σαράντα οκτώ")]
[InlineData(53, "πενήντα τρία")]
[InlineData(123647, "εκατόν είκοσι τρείς χιλιάδες εξακόσια σαράντα επτά")]
[InlineData(14000000, "δεκατέσσερα εκατομμύρια")]
[InlineData(578412, "πεντακόσιες εβδομήντα οκτώ χιλιάδες τετρακόσια δώδεκα")]
[InlineData(1000000000, "ένα δισεκατομμύριο")]
[InlineData(1000000001, "ένα δισεκατομμύριο ένα")]
[InlineData(1469, "χίλια τετρακόσια εξήντα εννέα")]
[InlineData(69, "εξήντα εννέα")]
[InlineData(619, "εξακόσια δεκαεννέα")]
[InlineData(1190, "χίλια εκατόν ενενήντα")]

[Theory]
public void ToWordsInt(int number, string expected) =>
Assert.Equal(expected, number.ToWords());
}
}
11 changes: 0 additions & 11 deletions src/Humanizer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{97AAE24D
Humanizer.ruleset = Humanizer.ruleset
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{1ABFDC1F-EAB0-48E1-B27E-388619899018}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Humanizer.Tests.Shared", "Humanizer.Tests.Shared\Humanizer.Tests.Shared.shproj", "{FDEC244B-F07E-4A5E-BB80-FBC6AC77A9AA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{04B74BEC-A645-4D1A-BE21-F4EB4413A903}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuSpecs", "NuSpecs", "{AA449265-E001-486D-A0F4-04ACF0C83DC1}"
ProjectSection(SolutionItems) = preProject
..\NuSpecs\Humanizer.Core.af.nuspec = ..\NuSpecs\Humanizer.Core.af.nuspec
Expand Down Expand Up @@ -91,9 +85,6 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "Benchmarks\Benchmarks.csproj", "{6ACDB92B-AC86-4C59-9114-5DCF9543D945}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Humanizer.Tests.Shared\Humanizer.Tests.Shared.projitems*{fdec244b-f07e-4a5e-bb80-fbc6ac77a9aa}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Expand Down Expand Up @@ -158,9 +149,7 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F886A8DA-3EFC-4A89-91DD-06FAF13DA172} = {04B74BEC-A645-4D1A-BE21-F4EB4413A903}
{97AAE24D-0488-42AE-A585-86D882F23D5F} = {4779A7C9-9ED8-4146-A158-FBE0B1BE09D9}
{FDEC244B-F07E-4A5E-BB80-FBC6AC77A9AA} = {04B74BEC-A645-4D1A-BE21-F4EB4413A903}
{AA449265-E001-486D-A0F4-04ACF0C83DC1} = {4779A7C9-9ED8-4146-A158-FBE0B1BE09D9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down