Closed johngallardo closed 1 year ago
Note from RandomDataGenerator:
using System;
namespace RandomDataGenerator.Generators
{
internal class RandomThingsGenerator<T>
{
private readonly RandomValueGenerator _randomValueGenerator;
private readonly T _min;
private readonly T _max;
public RandomThingsGenerator(T min, T max, int? seed)
{
_min = min;
_max = max;
_randomValueGenerator = new RandomValueGenerator(seed ?? Environment.TickCount);
}
public T Generate()
{
return _randomValueGenerator.Next(_min, _max);
}
}
}
@johngallardo This issue is solved by https://github.com/StefH/RandomDataGenerator/pull/26
A new version from Handlebars.Net.Helpers will be released shortly.
Consider a template spec:
And generation of data in a loop:
The randomly generated data rarely varies. Seems the root cause here is the usage of RandomDataGenerator creates a new Randomizer object on every iteration of generation. The result is not much randomness, as the different Randomizer's all seem to be initialized with a seed that is based on system clock.