ModelBuilder.UnitTests.RandomGeneratorTests.NextValueWithTypeReturnsDecimalValuesTest C# (CSharp) Method

NextValueWithTypeReturnsDecimalValuesTest() private method

private NextValueWithTypeReturnsDecimalValuesTest ( Type type ) : void
type Type
return void
        public void NextValueWithTypeReturnsDecimalValuesTest(Type type)
        {
            var decimalFound = false;

            var target = new RandomGenerator();

            for (var index = 0; index < 1000; index++)
            {
                var min = target.GetMin(type);
                var max = target.GetMax(type);

                var value = target.NextValue(type, min, max);

                var actual = Convert.ToDouble(value);

                if (unchecked(actual != (int) actual))
                {
                    decimalFound = true;

                    break;
                }
            }

            decimalFound.Should().BeTrue();
        }