mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-27 10:17:03 +08:00
21 lines
559 B
C#
21 lines
559 B
C#
using System.Linq;
|
|
using Xunit;
|
|
|
|
namespace Util.Tests.Helpers {
|
|
/// <summary>
|
|
/// 随机数操作测试
|
|
/// </summary>
|
|
public class RandomTest {
|
|
/// <summary>
|
|
/// 获取随机排序的集合
|
|
/// </summary>
|
|
[Fact]
|
|
public void TestSort() {
|
|
int[] input = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
|
var list = Util.Helpers.Random.Sort( input );
|
|
Assert.Equal( 10, list.Distinct().Count() );
|
|
Assert.NotEqual( "1,2,3,4,5,6,7,8,9,10", list.Join() );
|
|
}
|
|
}
|
|
}
|