diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-01-26 20:21:07 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-01-26 20:21:07 +0100 |
| commit | 80e22d9670f3ea8b722e1e57bc73529a5c652b25 (patch) | |
| tree | 3da4094abcd5bc044876a583c9de73912fc188d4 | |
| parent | 4a2678e63b0550e86a117fbbaf3b3ebb58ff8963 (diff) | |
Add test for ShuffleExtensions
| -rw-r--r-- | tests/Jellyfin.Common.Tests/Extensions/ShuffleExtensionsTests.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Jellyfin.Common.Tests/Extensions/ShuffleExtensionsTests.cs b/tests/Jellyfin.Common.Tests/Extensions/ShuffleExtensionsTests.cs new file mode 100644 index 000000000..cbdbcf112 --- /dev/null +++ b/tests/Jellyfin.Common.Tests/Extensions/ShuffleExtensionsTests.cs @@ -0,0 +1,22 @@ +using System; +using MediaBrowser.Common.Extensions; +using Xunit; + +namespace Jellyfin.Common.Tests.Extensions +{ + public static class ShuffleExtensionsTests + { + private static readonly Random _rng = new Random(); + + [Fact] + public static void Shuffle_Valid_Correct() + { + byte[] original = new byte[1 << 6]; + _rng.NextBytes(original); + byte[] shuffled = (byte[])original.Clone(); + shuffled.Shuffle(); + + Assert.NotEqual(original, shuffled); + } + } +} |
