Add test for ShuffleExtensions
This commit is contained in:
parent
4a2678e63b
commit
80e22d9670
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user