PseudoRandomTests RandomFloatSanityTest Method Delta Engine Documentation

Namespace: DeltaEngine.Tests.Core
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void RandomFloatSanityTest()
Examples

[Test, Category("Slow")]
public void RandomFloatSanityTest()
{
    var random = new PseudoRandom();
    const int Max = 10;
    var wasChosen = new bool[Max];
    const int Trials = Max * 1000;
    for (int i = 0; i < Trials; i++)
        wasChosen[(int)random.Get(0.0f, Max)] = true;
    for (int i = 0; i < Max; i++)
        Assert.IsTrue(wasChosen[i]);
}
See Also