PseudoRandomTests RandomIntSanityTest 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 RandomIntSanityTest()
Examples

[Test, Category("Slow")]
public void RandomIntSanityTest()
{
    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[random.Get(0, Max)] = true;
    for (int i = 0; i < Max; i++)
        Assert.IsTrue(wasChosen[i]);
}
See Also