Skip to content

Commit

Permalink
FEAT: Add missing values
Browse files Browse the repository at this point in the history
  • Loading branch information
janv8000 authored and MehdiK committed Nov 27, 2014
1 parent 90d8a44 commit 4f05a35
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 12 deletions.
80 changes: 68 additions & 12 deletions src/Humanizer.Tests/Localisation/nl/DateHumanizeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,108 @@ public class DateHumanizeTests : AmbientCulture
public DateHumanizeTests() : base("nl-NL") { }

[Theory]
[InlineData(-2, "2 dagen geleden")]
[InlineData(-1, "gisteren")]
[InlineData(2, "2 dagen geleden")]
[InlineData(1, "gisteren")]
public void DaysAgo(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past);
}

[Theory]
[InlineData(-2, "2 uur geleden")]
[InlineData(-1, "1 uur geleden")]
[InlineData(2, "2 uur geleden")]
[InlineData(1, "1 uur geleden")]
public void HoursAgo(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past);
}

[Theory]
[InlineData(-2, "2 minuten geleden")]
[InlineData(-1, "1 minuut geleden")]
[InlineData(2, "2 minuten geleden")]
[InlineData(1, "1 minuut geleden")]
[InlineData(60, "1 uur geleden")]
public void MinutesAgo(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past);
}

[Theory]
[InlineData(-2, "2 maanden geleden")]
[InlineData(-1, "1 maand geleden")]
[InlineData(2, "2 maanden geleden")]
[InlineData(1, "1 maand geleden")]
public void MonthsAgo(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past);
}

[Theory]
[InlineData(-2, "2 seconden geleden")]
[InlineData(-1, "1 seconde geleden")]
[InlineData(2, "2 seconden geleden")]
[InlineData(1, "1 seconde geleden")]
public void SecondsAgo(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past);
}

[Theory]
[InlineData(-2, "2 jaar geleden")]
[InlineData(-1, "1 jaar geleden")]
[InlineData(2, "2 jaar geleden")]
[InlineData(1, "1 jaar geleden")]
public void YearsAgo(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past);
}

[Theory]
[InlineData(2, "over 2 dagen")]
[InlineData(1, "morgen")]
public void DaysFromNow(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 uur")]
[InlineData(1, "over 1 uur")]
public void HoursFromNow(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 minuten")]
[InlineData(1, "over 1 minuut")]
[InlineData(60, "over 1 uur")]
public void MinutesFromNow(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 maanden")]
[InlineData(1, "over 1 maand")]
public void MonthsFromNow(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 seconden")]
[InlineData(1, "over 1 seconde")]
public void SecondsFromNow(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future);
}

[Theory]
[InlineData(2, "over 2 jaar")]
[InlineData(1, "over 1 jaar")]
public void YearsFromNow(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future);
}

[Theory]
[InlineData(0, "nu")]
public void RightNow(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future);
}
}
}
39 changes: 39 additions & 0 deletions src/Humanizer/Properties/Resources.nl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,43 @@
<data name="TimeSpanHumanize_Zero" xml:space="preserve">
<value>geen tijd</value>
</data>
<data name="DateHumanize_MultipleDaysFromNow">
<value>over {0} dagen</value>
</data>
<data name="DateHumanize_MultipleHoursFromNow">
<value>over {0} uur</value>
</data>
<data name="DateHumanize_MultipleMinutesFromNow">
<value>over {0} minuten</value>
</data>
<data name="DateHumanize_MultipleMonthsFromNow">
<value>over {0} maanden</value>
</data>
<data name="DateHumanize_MultipleSecondsFromNow">
<value>over {0} seconden</value>
</data>
<data name="DateHumanize_MultipleYearsFromNow">
<value>over {0} jaar</value>
</data>
<data name="DateHumanize_Now">
<value>nu</value>
</data>
<data name="DateHumanize_SingleDayFromNow">
<value>morgen</value>
</data>
<data name="DateHumanize_SingleHourFromNow">
<value>over 1 uur</value>
</data>
<data name="DateHumanize_SingleMinuteFromNow">
<value>over 1 minuut</value>
</data>
<data name="DateHumanize_SingleMonthFromNow">
<value>over 1 maand</value>
</data>
<data name="DateHumanize_SingleSecondFromNow">
<value>over 1 seconde</value>
</data>
<data name="DateHumanize_SingleYearFromNow">
<value>over 1 jaar</value>
</data>
</root>

0 comments on commit 4f05a35

Please sign in to comment.