Skip to content

Enumerate an enum in C#: move to .NET 10, fix tests, add OrderStatus and benchmarks - #2366

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/77815-enumerate-enum-csharp
Nov 21, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/77815-enumerate-enum-csharp

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the EnumerateAnEnumInCSharp sample to net10.0 with MSTest 4.5.2, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0. The tests now run against the sample's own internal DayOfWeek enum (InternalsVisibleTo plus a using alias) instead of System.DayOfWeek, the generic helper returns TEnum[] like Enum.GetValues(), Program.cs follows the article's snippets in order including GetValuesAsUnderlyingType, a new OrderStatus enum with three tests shows the unsigned sort order and duplicate values, and a small BenchmarkDotNet project measures the generic, Type and reflection routes.

@vladimir-pecanac-main
vladimir-pecanac-main merged commit f8ec657 into CodeMazeBlog:main Nov 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant