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

31 lines
759 B
C#

using KLHZ.Trader.Core.Math.Declisions.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
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);
}
}
}