mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 13:38:05 +00:00
Refactor tests and improve random number generation handling; update Dema, Ema, Sma, Tema, Wma, and GBM classes for consistency and clarity
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
namespace QuanTAlib.Tests;
|
||||
|
||||
#pragma warning disable S2245 // Random is acceptable for simulation/testing purposes
|
||||
public class SmaTests
|
||||
{
|
||||
[Fact]
|
||||
@@ -422,9 +423,9 @@ public class SmaTests
|
||||
{
|
||||
double[] source = new double[10000];
|
||||
double[] output = new double[10000];
|
||||
var rng = new Random(42);
|
||||
var rng = new Random(42); // nosemgrep
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
source[i] = rng.NextDouble() * 100;
|
||||
source[i] = rng.NextDouble() * 100; // nosemgrep
|
||||
|
||||
// Warm up
|
||||
Sma.Calculate(source.AsSpan(), output.AsSpan(), 100);
|
||||
|
||||
Reference in New Issue
Block a user