Skip to content

Commit

Permalink
updated sk date tests to use Verify
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiK committed Apr 6, 2014
1 parent 52920fe commit 17c55ae
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 37 deletions.
4 changes: 1 addition & 3 deletions src/Humanizer.Tests/Localisation/de/DateHumanizeTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using Humanizer.Localisation;
using Xunit;
using Humanizer.Localisation;
using Xunit.Extensions;

namespace Humanizer.Tests.Localisation.de
Expand Down
67 changes: 33 additions & 34 deletions src/Humanizer.Tests/Localisation/sk/DateHumanizeTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Xunit;
using Humanizer.Localisation;
using Xunit.Extensions;

namespace Humanizer.Tests.Localisation.sk
Expand All @@ -19,9 +18,9 @@ public DateHumanizeTests()
[InlineData(5, "o 5 sekúnd")]
[InlineData(6, "o 6 sekúnd")]
[InlineData(10, "o 10 sekúnd")]
public void SecondsFromNow(int number, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddSeconds(number).Humanize());
public void SecondsFromNow(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future);
}

[Theory]
Expand All @@ -32,9 +31,9 @@ public void SecondsFromNow(int number, string expected)
[InlineData(5, "o 5 minút")]
[InlineData(6, "o 6 minút")]
[InlineData(10, "o 10 minút")]
public void MinutesFromNow(int number, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddMinutes(number).Humanize());
public void MinutesFromNow(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future);
}

[Theory]
Expand All @@ -45,21 +44,21 @@ public void MinutesFromNow(int number, string expected)
[InlineData(5, "o 5 hodín")]
[InlineData(6, "o 6 hodín")]
[InlineData(10, "o 10 hodín")]
public void HoursFromNow(int number, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddHours(number).Humanize());
public void HoursFromNow(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future);
}

[Theory]
[InlineData(1, "zajtra")]
[InlineData(2, "o 2 dni")]
[InlineData(3, "o 3 dni")]
[InlineData(4, "o 4 dni")]
[InlineData(9, "o 9 dní")]
[InlineData(10, "o 10 dní")]
public void DayFromNow(int number, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddDays(number).Humanize());
public void DaysFromNow(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future);
}

[Theory]
Expand All @@ -70,9 +69,9 @@ public void DayFromNow(int number, string expected)
[InlineData(5, "o 5 mesiacov")]
[InlineData(6, "o 6 mesiacov")]
[InlineData(10, "o 10 mesiacov")]
public void MonthsFromNow(int number, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddMonths(number).Humanize());
public void MonthsFromNow(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future);
}

[Theory]
Expand All @@ -83,9 +82,9 @@ public void MonthsFromNow(int number, string expected)
[InlineData(5, "o 5 rokov")]
[InlineData(6, "o 6 rokov")]
[InlineData(10, "o 10 rokov")]
public void YearsFromNow(int number, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddYears(number).Humanize());
public void YearsFromNow(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future);
}

[Theory]
Expand All @@ -96,9 +95,9 @@ public void YearsFromNow(int number, string expected)
[InlineData(5, "pred 5 sekundami")]
[InlineData(6, "pred 6 sekundami")]
[InlineData(10, "pred 10 sekundami")]
public void SecondsAgo(int number, string expected)
public void SecondsAgo(int seconds, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddSeconds(-1*number).Humanize());
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past);
}

[Theory]
Expand All @@ -109,9 +108,9 @@ public void SecondsAgo(int number, string expected)
[InlineData(5, "pred 5 minútami")]
[InlineData(6, "pred 6 minútami")]
[InlineData(10, "pred 10 minútami")]
public void MinutesAgo(int number, string expected)
public void MinutesAgo(int minutes, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddMinutes(-1*number).Humanize());
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past);
}

[Theory]
Expand All @@ -122,9 +121,9 @@ public void MinutesAgo(int number, string expected)
[InlineData(5, "pred 5 hodinami")]
[InlineData(6, "pred 6 hodinami")]
[InlineData(10, "pred 10 hodinami")]
public void HoursAgo(int number, string expected)
public void HoursAgo(int hours, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddHours(-1*number).Humanize());
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past);
}

[Theory]
Expand All @@ -134,9 +133,9 @@ public void HoursAgo(int number, string expected)
[InlineData(4, "pred 4 dňami")]
[InlineData(9, "pred 9 dňami")]
[InlineData(10, "pred 10 dňami")]
public void DayAgo(int number, string expected)
public void DaysAgo(int days, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddDays(-1*number).Humanize());
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past);
}

[Theory]
Expand All @@ -147,9 +146,9 @@ public void DayAgo(int number, string expected)
[InlineData(5, "pred 5 mesiacmi")]
[InlineData(6, "pred 6 mesiacmi")]
[InlineData(10, "pred 10 mesiacmi")]
public void MonthsAgo(int number, string expected)
public void MonthsAgo(int months, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddMonths(-1*number).Humanize());
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past);
}

[Theory]
Expand All @@ -160,9 +159,9 @@ public void MonthsAgo(int number, string expected)
[InlineData(5, "pred 5 rokmi")]
[InlineData(6, "pred 6 rokmi")]
[InlineData(10, "pred 10 rokmi")]
public void YearsAgo(int number, string expected)
public void YearsAgo(int years, string expected)
{
Assert.Equal(expected, DateTime.UtcNow.AddYears(-1*number).Humanize());
}
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past);
}
}
}

0 comments on commit 17c55ae

Please sign in to comment.