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

NextValueWithTypeReturnsNewValueTest() private method

private NextValueWithTypeReturnsNewValueTest ( Type type, bool typeSupported, double min, double max ) : void
type Type
typeSupported bool
min double
max double
return void
        public void NextValueWithTypeReturnsNewValueTest(Type type, bool typeSupported, double min, double max)
        {
            if (typeSupported == false)
            {
                // Ignore this test
                return;
            }

            var target = new RandomGenerator();

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

            value.Should().NotBeNull();

            if (type.IsNullable())
            {
                value.Should().BeOfType(type.GetGenericArguments()[0]);
            }
            else
            {
                value.Should().BeOfType(type);
            }
        }