diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2021-02-04 23:23:11 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-04 23:23:11 +0900 |
| commit | 793ae6f7a67ecda14efa9e66f2b5c9eb56dfd98e (patch) | |
| tree | 53dd467ade896ffe5d2a97f1c8fc4085cd976601 /tests | |
| parent | 6afbc98b604cae015116c1cf31e7592239d8f251 (diff) | |
| parent | bf4829a38ce6b393c2bbab258c4a7ebe5ee33aba (diff) | |
Merge pull request #5112 from jellyfin/shuffle
Add test for ShuffleExtensions
Diffstat (limited to 'tests')
| -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); + } + } +} |
