diff --git a/src/Humanizer.Tests/Humanizer.Tests.csproj b/src/Humanizer.Tests/Humanizer.Tests.csproj index 9e9be0aa4..aaa08543a 100644 --- a/src/Humanizer.Tests/Humanizer.Tests.csproj +++ b/src/Humanizer.Tests/Humanizer.Tests.csproj @@ -71,6 +71,7 @@ + diff --git a/src/Humanizer.Tests/Localisation/ar/TimeSpanTests.cs b/src/Humanizer.Tests/Localisation/ar/TimeSpanTests.cs new file mode 100644 index 000000000..f86fbb301 --- /dev/null +++ b/src/Humanizer.Tests/Localisation/ar/TimeSpanTests.cs @@ -0,0 +1,52 @@ +using System; +using Xunit; + +namespace Humanizer.Tests.Localisation.ar +{ + public class TimeSpanHumanizeExtensionsTests : AmbientCulture + { + public TimeSpanHumanizeExtensionsTests() : base("ar") { } + + [Fact] + public void OneWeek() + { + Assert.Equal("أسبوع واحد", TimeSpan.FromDays(7).Humanize()); + } + + [Fact] + public void OneDay() + { + Assert.Equal("يوم واحد", TimeSpan.FromDays(1).Humanize()); + } + + [Fact] + public void OneHour() + { + Assert.Equal("ساعة واحدة", TimeSpan.FromHours(1).Humanize()); + } + + [Fact] + public void OneMinute() + { + Assert.Equal("دقيقة واحدة", TimeSpan.FromMinutes(1).Humanize()); + } + + [Fact] + public void OneSecond() + { + Assert.Equal("ثانية واحدة", TimeSpan.FromSeconds(1).Humanize()); + } + + [Fact] + public void OneMillisecond() + { + Assert.Equal("جزء من الثانية", TimeSpan.FromMilliseconds(1).Humanize()); + } + + [Fact] + public void NoTime() + { + Assert.Equal("حالاً", TimeSpan.Zero.Humanize()); + } + } +} \ No newline at end of file diff --git a/src/Humanizer/Properties/Resources.ar.resx b/src/Humanizer/Properties/Resources.ar.resx index 083e76af7..b0ffcc3dc 100644 --- a/src/Humanizer/Properties/Resources.ar.resx +++ b/src/Humanizer/Properties/Resources.ar.resx @@ -169,4 +169,32 @@ منذ {0} سنوات {0} years ago + + يوم واحد + single day + + + ساعة واحدة + single hour + + + جزء من الثانية + single millisecond + + + دقيقة واحدة + single minute + + + ثانية واحدة + single second + + + أسبوع واحد + single week + + + حالاً + no time + \ No newline at end of file