public void ShouldThrowsArgumentException()
        {
            // We need to check for the value that is NOT in enum
            PersonType type = (PersonType)2;

            Action act = () => type.GetPersonTypes();

            act.Should().Throw <ArgumentException>();
        }
Exemplo n.º 2
0
        public static bool IsPersonTypeOf(this string personType, PersonType expectedEnumItem)
        {
            if (personType == null)
            {
                return(false);
            }

            var allowedTypes = expectedEnumItem.GetPersonTypes().Select(s => s.ToUpper());

            return(allowedTypes.Contains(personType.ToUpper()));
        }