public void Test__SystemRng__NextDoubleMinMaxValue03__ExpectException() { const double minValue = 2.22; const double maxValue = -3.34; IPsuedoRandomNumberGenerator generator = Factory.SystemRngPump.NewInstance(); Assert.Throws <ArgumentOutOfRangeException>(() => generator.NextDouble(minValue, maxValue)); }
public void Test__SystemRng__NextDoubleMinMaxValue06__ExpectAreEqual() { const double inputValue = double.MaxValue; IPsuedoRandomNumberGenerator generator = Factory.SystemRngPump.NewInstance(); var actual = generator.NextDouble(inputValue, inputValue); Assert.IsNotNull(actual); Assert.AreEqual(actual, inputValue); }
public void Test__SystemRng__NextDoubleMaxValue06__ExpectLessThan() { const double maxValue = double.MaxValue; IPsuedoRandomNumberGenerator generator = Factory.SystemRngPump.NewInstance(); var actual = generator.NextDouble(maxValue); Assert.IsNotNull(actual); Assert.IsTrue(actual < maxValue); }
public void Test__SystemRng__NextDoubleMaxValue__ExpectAreEqual() { const double maxValue = 0.00; IPsuedoRandomNumberGenerator generator = Factory.SystemRngPump.NewInstance(); var actual = generator.NextDouble(maxValue); Assert.IsNotNull(actual); Assert.AreEqual(actual, maxValue); }
public void Test__SystemRng__NextDoubleMinMaxValue07__ExpectRange() { const double minValue = 0.99; const double maxValue = 1.11; IPsuedoRandomNumberGenerator generator = Factory.SystemRngPump.NewInstance(); var actual = generator.NextDouble(minValue, maxValue); Assert.IsNotNull(actual); Assert.IsTrue(actual < maxValue); Assert.IsTrue(actual >= minValue); }
public void Test__SystemRng__NextDouble__ExpectSomeIntegerValues() { const int numGenerations = 1000000; // test one meellion iterations IPsuedoRandomNumberGenerator generator = Factory.SystemRngPump.NewInstance(); for (var i = 0; i < numGenerations; i++) { var actual = generator.NextDouble(); Assert.IsNotNull(actual); Assert.IsTrue(actual >= 0.00); Assert.IsTrue(actual < 1.00); } }
public void Test__SystemRng__NextDoubleMaxValue02__ExpectException() { IPsuedoRandomNumberGenerator generator = Factory.SystemRngPump.NewInstance(); Assert.Throws <ArgumentOutOfRangeException>(() => generator.NextDouble(double.MinValue)); }