klhztrader/KLHZ.Trader.Core.Tests/StatisticTests.cs

26 lines
639 B
C#

using KLHZ.Trader.Core.Math.Declisions.Utils;
using System.Security.Cryptography;
namespace KLHZ.Trader.Core.Tests
{
internal class StatisticTests
{
[Test]
public static void Test()
{
var data = new decimal[1000];
for (int i = 0; i < data.Length; i++)
{
data[i] = RandomNumberGenerator.GetInt32(-10, 10);
}
data[0] = 1000;
var res = Statistics.ClearNSigmaReqursive(data);
Assert.IsTrue(data.Length != res.Length);
Assert.IsTrue(res[0] != 1000);
}
}
}