diff --git a/osu.Game.Rulesets.Karaoke.Tests/Helper/TestCaseListHelper.cs b/osu.Game.Rulesets.Karaoke.Tests/Helper/TestCaseListHelper.cs new file mode 100644 index 000000000..b617fccad --- /dev/null +++ b/osu.Game.Rulesets.Karaoke.Tests/Helper/TestCaseListHelper.cs @@ -0,0 +1,26 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace osu.Game.Rulesets.Karaoke.Tests.Helper +{ + public static class TestCaseListHelper + { + private static readonly Random rng = new(); + + /// + /// Random the order of the list. + /// + /// + /// + /// + public static IList Shuffle(IList list) + { + // see: https://stackoverflow.com/a/4262134 + return list.OrderBy(_ => rng.Next()).ToList(); + } + } +}