FixedRandomTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Tests.Core FixedRandomTests

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

public class FixedRandomTests

The FixedRandomTests type exposes the following members.

Constructors

  NameDescription
Public methodFixedRandomTests
Initializes a new instance of the FixedRandomTests class
Top
Methods

  NameDescription
Public methodFixedValueOutOfRangeThrowsException
Public methodGet
Public methodGetWithNoFixedValuesAssigned
Top
Examples

[Test]
public void Get()
{
    var random = new FixedRandom(new[] { 0.1f, 0.2f });
[Test]
public void GetWithNoFixedValuesAssigned()
{
    var random = new FixedRandom();
    Assert.AreEqual(-3, random.Get(-3, 5));
    Assert.AreEqual(-7.1f, random.Get(-7.1f, -1.1f));
}
[Test]
public void FixedValueOutOfRangeThrowsException()
{
    Assert.Throws<FixedRandom.FixedValueOutOfRange>(
        () => new FixedRandom(new[] { 0.0f, 1.0f, 0.0f }));
    Assert.Throws<FixedRandom.FixedValueOutOfRange>(() => new FixedRandom(new[] { -0.01f }));
}
See Also