mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
25 lines
598 B
C#
25 lines
598 B
C#
using System;
|
|
|
|
namespace Wabbajack.Common.Test
|
|
{
|
|
public static class TestUtils
|
|
{
|
|
private static Random _random = new Random();
|
|
|
|
public static byte[] RandomData(int? size = null, int maxSize = 1024)
|
|
{
|
|
if (size == null)
|
|
size = _random.Next(1, maxSize);
|
|
var arr = new byte[(int) size];
|
|
_random.NextBytes(arr);
|
|
return arr;
|
|
}
|
|
|
|
public static object RandomOne(params object[] opts)
|
|
{
|
|
return opts[_random.Next(0, opts.Length)];
|
|
}
|
|
|
|
}
|
|
}
|