-
Notifications
You must be signed in to change notification settings - Fork 967
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
45 additions
and
1,986 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
36 changes: 36 additions & 0 deletions
36
src/Humanizer.Tests.Shared/Localisation/pt-BR/TimeToClockNotationTests.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,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 |
Oops, something went wrong.