Auto stash before merge of "main" and "origin/main"

This commit is contained in:
Miha Kralj
2024-10-08 18:49:28 -07:00
parent e3f4459034
commit c2c3bdda15
2 changed files with 42 additions and 31 deletions
+18 -7
View File
@@ -51,23 +51,34 @@ public class EventingTests
};
// 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;
<<<<<<< HEAD
input.Add(randomValue);
=======
input.Add(randomValue);
>>>>>>> dev
// Calculate direct indicators
foreach (var (direct, _) in indicators)
{
direct.Calc(randomValue);
}
}
}
// Compare the results of direct and event-based calculations
foreach (var (direct, eventBased) in indicators)
{
Assert.Equal(direct.Value, eventBased.Value, 9);
}
// Compare the results of direct and event-based calculations
foreach (var (direct, eventBased) in indicators)
{
Assert.Equal(direct.Value, eventBased.Value, 9);
}
}
private static double GetRandomDouble(RandomNumberGenerator rng)
{
byte[] bytes = new byte[8];
rng.GetBytes(bytes);
return (double)BitConverter.ToUInt64(bytes, 0) / ulong.MaxValue;
}
private static double GetRandomDouble(RandomNumberGenerator rng)