Somebody gives me a type t.
I’d like to know if that type is an enumeration or not.
public bool IsEnumeration(Type t)
{
// Mystery Code.
throw new NotImplementedException();
}
public void IsEnumerationChecker()
{
Assert.IsTrue(IsEnumeration(typeof(Color)));
Assert.IsFalse(IsEnumeration(typeof(float)));
}
You can also check by using property
IsEnumonType: