Could someone please point me toward a cleaner method to generate a random enum member. This works but seems ugly.
Thanks!
public T RandomEnum<T>()
{
string[] items = Enum.GetNames(typeof( T ));
Random r = new Random();
string e = items[r.Next(0, items.Length - 1)];
return (T)Enum.Parse(typeof (T), e, true);
}