diff --git a/src/Humanizer.Tests/Bytes/ComparingTests.cs b/src/Humanizer.Tests/Bytes/ComparingTests.cs index d20d27537..a1877a372 100644 --- a/src/Humanizer.Tests/Bytes/ComparingTests.cs +++ b/src/Humanizer.Tests/Bytes/ComparingTests.cs @@ -1,4 +1,6 @@ -using Humanizer.Bytes; +using System.Collections.Generic; +using System.Linq; +using Humanizer.Bytes; using Xunit; using Xunit.Extensions; @@ -31,5 +33,16 @@ public void CompareUntyped(double value, double valueToCompareWith, int expected Assert.Equal(expectedResult, result); } + + [Theory] + [InlineData(new[] { "1GB", "3KB", "5MB" }, new[] { "3KB", "5MB", "1GB"})] + [InlineData(new[] { "1MB", "3KB", "5MB" }, new[] { "3KB", "1MB", "5MB"})] + public void SortList(IEnumerable values, IEnumerable expected) + { + var list = values.Select(ByteSize.Parse).ToList(); + list.Sort(); + + Assert.Equal(expected.Select(ByteSize.Parse), list); + } } } \ No newline at end of file