Here’s a simple unit test that checks it, should be a bit faster:
[TestMethod]
public void Test()
{
var enums = (myEnum[])Enum.GetValues(typeof(myEnum));
Assert.IsTrue(enums.Count() == enums.Distinct().Count());
}
More Related Contents:
- How to enumerate an enum
- Enum “Inheritance”
- Get Enum from Description attribute [duplicate]
- Anyone know a good workaround for the lack of an enum generic constraint?
- How to loop through all enum values in C#? [duplicate]
- Most common C# bitwise operations on enums
- Enum type constraints in C# [duplicate]
- Get enum from enum attribute
- Why switch for enum accepts implicit conversion to 0 but no for any other integer?
- How do I convert an enum to a list in C#? [duplicate]
- Why enums require an explicit cast to int type?
- How to Compare Flags in C#?
- How to convert a character in to equivalent System.Windows.Input.Key Enum value?
- Parse string to enum type
- What is the default value for enum variable?
- .NET Enumeration allows comma in the last field
- C# int, Int32 and enums
- Binding an enum to a WinForms combo box, and then setting it
- Total number of items defined in an enum
- How to get next (or previous) enum value in C#
- Choosing the default value of an Enum type without having to change values
- How to add extension methods to Enums
- Why Enum’s HasFlag method need boxing?
- Can you have multiple enum values for the same integer? [duplicate]
- Comparing double values in C#
- List vs BindingList Advantages/DisAdvantages
- Insert data using Entity Framework model
- Why use async and return await, when you can return Task directly?
- How to sort a dictionary by key
- What’s the purpose of GC.SuppressFinalize(this) in Dispose() method?