public void EnumValue_returns_random_enumeration_value()
        {
            var actual = GetRandom.EnumValue <DayOfWeek>();

            actual.ShouldBeOfType <DayOfWeek>();
            Enum.IsDefined(typeof(DayOfWeek), actual).ShouldBeTrue();
        }
        public void EnumValue_returns_random_enumeration_value_with_exclude()
        {
            var notExpected = GetRandom.EnumValue <DayOfWeek>();
            var actual      = GetRandom.EnumValue(notExpected);

            actual.ShouldBeOfType <DayOfWeek>();
            Enum.IsDefined(typeof(DayOfWeek), actual).ShouldBeTrue();
            actual.ShouldNotBe(notExpected);
        }
        public void GetRandom_EnumValue_should_work()
        {
            StringComparison randomValue = GetRandom.EnumValue <StringComparison>();

            Assert.IsNotNull(randomValue);
        }
 /// <summary>
 /// Get random <see cref="Enum"/>  value.
 /// </summary>
 /// <typeparam name="TEnum">The <see cref="Enum"/> type.</typeparam>
 /// <returns>Random <typeparamref name="TEnum"/> value.</returns>
 public static TEnum EnumValue <TEnum>() where TEnum : Enum => GetRandom.EnumValue <TEnum>();
        public void EnumValue_with_exclude_throws_ArgumentException_for_non_enumeration_type_parameter()
        {
            Action action = () => GetRandom.EnumValue(string.Empty);

            action.ShouldThrow <ArgumentException>();
        }