mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 19:18:05 +00:00
style: format code with dotnet-format
This commit fixes the style issues introduced in 14ec3cd according to the output
from dotnet-format.
Details: https://github.com/mihakralj/QuanTAlib/pull/35
This commit is contained in:
+13
-13
@@ -51,29 +51,29 @@ public class EventingTests
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Generate 200 random values and feed them to both direct and event-based indicators
|
// Generate 200 random values and feed them to both direct and event-based indicators
|
||||||
for (int i = 0; i < 200; i++)
|
for (int i = 0; i< 200; i++)
|
||||||
{
|
{
|
||||||
double randomValue = GetRandomDouble(rng) * 100;
|
double randomValue = GetRandomDouble(rng) * 100;
|
||||||
input.Add(randomValue);
|
input.Add(randomValue);
|
||||||
|
|
||||||
// Calculate direct indicators
|
// Calculate direct indicators
|
||||||
foreach (var (direct, _) in indicators)
|
foreach (var (direct, _) in indicators)
|
||||||
{
|
{
|
||||||
direct.Calc(randomValue);
|
direct.Calc(randomValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compare the results of direct and event-based calculations
|
// Compare the results of direct and event-based calculations
|
||||||
foreach (var (direct, eventBased) in indicators)
|
foreach (var (direct, eventBased) in indicators)
|
||||||
{
|
{
|
||||||
Assert.Equal(direct.Value, eventBased.Value, 9);
|
Assert.Equal(direct.Value, eventBased.Value, 9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double GetRandomDouble(RandomNumberGenerator rng)
|
private static double GetRandomDouble(RandomNumberGenerator rng)
|
||||||
{
|
{
|
||||||
byte[] bytes = new byte[8];
|
byte[] bytes = new byte[8];
|
||||||
rng.GetBytes(bytes);
|
rng.GetBytes(bytes);
|
||||||
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue;
|
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user