public void TestNextFloat()
        {
            float value = RandomFloat.NextFloat(5);

            Assert.True(value < 5);

            value = RandomFloat.NextFloat(2, 5);
            Assert.True(value < 5 && value > 2);
        }
Пример #2
0
        public static DateTime UpdateDateTime(DateTime value, float range)
        {
            range = range != 0 ? range : 10;
            if (range < 0)
            {
                return(value);
            }

            float days = RandomFloat.NextFloat(-range, range);

            return(value.AddDays((int)days));
        }
        public void TestUpdateFloat()
        {
            float value = RandomFloat.UpdateFloat(0, 5);

            Assert.True(value <= 5 && value >= -5);
        }