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

NextValueWithTypeValidatesRequestedTypeTest() private method

private NextValueWithTypeValidatesRequestedTypeTest ( Type type, bool typeSupported, double min, double max ) : void
type Type
typeSupported bool
min double
max double
return void
        public void NextValueWithTypeValidatesRequestedTypeTest(Type type, bool typeSupported, double min, double max)
        {
            var target = new RandomGenerator();

            Action action = () => target.NextValue(type, min, max);

            if (typeSupported)
            {
                action.ShouldNotThrow();
            }
            else
            {
                action.ShouldThrow<NotSupportedException>();
            }
        }
    }