Skip to content

Commit

Permalink
Address PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
strobelt committed Oct 28, 2021
1 parent f20c6f3 commit 7778993
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 1,986 deletions.
2 changes: 2 additions & 0 deletions src/Humanizer.Tests.Shared/Humanizer.Tests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<Compile Include="$(MSBuildThisFileDirectory)DateHumanizeDefaultStrategyTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)FluentDate\InDateTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)FluentDate\OnDateTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\en\TimeToClockNotationTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\is\Bytes\ByteSizeExtensionsTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\is\Bytes\ToFullWordsTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\is\Bytes\ToStringTests.cs" />
Expand All @@ -36,6 +37,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Localisation\is\ResourcesTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\is\TimeOnlyHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\is\TimeSpanHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Localisation\pt-BR\TimeToClockNotationTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TimeOnlyHumanizeTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DateTimeHumanizePrecisionStrategyTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)DateOnlyHumanizeTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,6 @@ public void ConvertToClockNotationTimeOnlyStringEnUs(int hours, int minutes, str
var actualResult = new TimeOnly(hours, minutes).ToClockNotation();
Assert.Equal(expectedResult, actualResult);
}

[UseCulture("pt-BR")]
[Theory]
[InlineData(00, 00, "meia-noite")]
[InlineData(04, 00, "quatro em ponto")]
[InlineData(05, 01, "cinco e um")]
[InlineData(06, 05, "seis e cinco")]
[InlineData(07, 10, "sete e dez")]
[InlineData(08, 15, "oito e quinze")]
[InlineData(09, 20, "nove e vinte")]
[InlineData(10, 25, "dez e vinte e cinco")]
[InlineData(11, 30, "onze e meia")]
[InlineData(12, 00, "meio-dia")]
[InlineData(15, 35, "três e trinta e cinco")]
[InlineData(16, 40, "vinte para as cinco")]
[InlineData(17, 45, "quinze para as seis")]
[InlineData(18, 50, "dez para as sete")]
[InlineData(19, 55, "cinco para as oito")]
[InlineData(20, 59, "oito e cinquenta e nove")]
public void ConvertToClockNotationTimeOnlyStringPtBr(int hours, int minutes, string expectedResult)
{
var actualResult = new TimeOnly(hours, minutes).ToClockNotation();
Assert.Equal(expectedResult, actualResult);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#if NET6_0_OR_GREATER

using System;
using Xunit;

namespace Humanizer.Tests.Localisation.ptBR
{
[UseCulture("pt-BR")]
public class TimeToClockNotationTests
{
[Theory]
[InlineData(00, 00, "meia-noite")]
[InlineData(04, 00, "quatro em ponto")]
[InlineData(05, 01, "cinco e um")]
[InlineData(06, 05, "seis e cinco")]
[InlineData(07, 10, "sete e dez")]
[InlineData(08, 15, "oito e quinze")]
[InlineData(09, 20, "nove e vinte")]
[InlineData(10, 25, "dez e vinte e cinco")]
[InlineData(11, 30, "onze e meia")]
[InlineData(12, 00, "meio-dia")]
[InlineData(15, 35, "três e trinta e cinco")]
[InlineData(16, 40, "vinte para as cinco")]
[InlineData(17, 45, "quinze para as seis")]
[InlineData(18, 50, "dez para as sete")]
[InlineData(19, 55, "cinco para as oito")]
[InlineData(20, 59, "oito e cinquenta e nove")]
public void ConvertToClockNotationTimeOnlyStringPtBr(int hours, int minutes, string expectedResult)
{
var actualResult = new TimeOnly(hours, minutes).ToClockNotation();
Assert.Equal(expectedResult, actualResult);
}
}
}

#endif
Loading

0 comments on commit 7778993

Please sign in to comment.