public void NextFloatNonZero_Max() { var rng = new ConstantRandomSource(ulong.MaxValue); double x = rng.NextFloatNonZero(); Assert.Equal(1f, x); }
public void NextDoubleNonZero_Min() { var rng = new ConstantRandomSource(0UL); double x = rng.NextDoubleNonZero(); Assert.Equal(INCR_DOUBLE, x); }
public void NextUInt_MinVal() { var rng = new ConstantRandomSource(0UL); uint x = rng.NextUInt(); Assert.Equal(0u, x); }
public void NextFloatNonZero_Min() { var rng = new ConstantRandomSource(0UL); double x = rng.NextFloatNonZero(); Assert.Equal(INCR_FLOAT, x); }
public void NextByte_MaxVal() { var rng = new ConstantRandomSource(0xFFUL << 56); byte x = rng.NextByte(); Assert.Equal(255, x); }
public void NextFloat_MinVal() { var rng = new ConstantRandomSource(0UL); float x = rng.NextFloat(); Assert.Equal(0f, x); }
public void NextBool_False() { var rng = new ConstantRandomSource(0UL); bool x = rng.NextBool(); Assert.False(x); }
public void NextByte_MinVal() { var rng = new ConstantRandomSource(0UL); byte x = rng.NextByte(); Assert.Equal(0, x); }
public void NextULong_MaxVal() { var rng = new ConstantRandomSource(ulong.MaxValue); ulong x = rng.NextULong(); Assert.Equal(ulong.MaxValue, x); }
public void NextULong_MinVal() { var rng = new ConstantRandomSource(0UL); ulong x = rng.NextULong(); Assert.Equal(0UL, x); }
public void NextUInt_MaxVal() { var rng = new ConstantRandomSource(ulong.MaxValue); uint x = rng.NextUInt(); Assert.Equal(uint.MaxValue, x); }
public void NextDoubleHighRes_Max() { var rng = new ConstantRandomSource(ulong.MaxValue); double x = rng.NextDoubleHighRes(); Assert.Equal(1.0, x); }
public void NextFloat_MaxVal() { var rng = new ConstantRandomSource(ulong.MaxValue); float x = rng.NextFloat(); Assert.Equal(1.0 - INCR_FLOAT, x); }
public void NextDouble_MinVal() { var rng = new ConstantRandomSource(0UL); double x = rng.NextDouble(); Assert.Equal(0.0, x); }
public void NextDouble_MaxVal() { var rng = new ConstantRandomSource(ulong.MaxValue); double x = rng.NextDouble(); Assert.Equal(1.0 - INCR_DOUBLE, x); }
public void NextMinMax_MinVal() { var rng = new ConstantRandomSource(0UL); int x = rng.Next(123, 1_234_567); Assert.Equal(123, x); }
public void NextMax_MaxVal() { const int max = 1_234_567; var rng = new ConstantRandomSource(((ulong)(max - 1)) << 43); int x = rng.Next(max); Assert.Equal(max - 1, x); }
public void NextMinMax_LongRange_MinVal() { const int maxValHalf = int.MaxValue / 2; const int lowerBound = -maxValHalf; const int upperBound = maxValHalf + 123; var rng = new ConstantRandomSource(0UL); int x = rng.Next(lowerBound, upperBound); Assert.Equal(lowerBound, x); }