Skip to content

SortingGenericList: .NET 10, comparer null contract fix, IndexOf duplicates - #2377

Merged
vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/94710-csharp-techniques-for-sorting-list
Nov 9, 2026
Merged

vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/94710-csharp-techniques-for-sorting-list

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves collections-lists/SortingGenericList to net10.0 with xunit 2.9.3, xunit.runner.visualstudio 4.0.1, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0, and replaces FluentAssertions with plain xUnit asserts under the same test names. Product.DescendingCompare now goes through Comparer.Default so two null products compare as equal (the old form returned -1 and List.Sort threw on lists with many nulls), MySortedList.IndexOf returns the first of several equal items, Program.cs adds a Comparer.Create example, and four new tests cover these cases (57 tests in total).

…act and IndexOf duplicates

Target net10.0, update xunit 2.9.3, xunit.runner.visualstudio 4.0.1, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0, and replace FluentAssertions with plain xUnit asserts. DescendingCompare goes through Comparer<Product>.Default so two nulls compare as equal, MySortedList.IndexOf returns the first of several equal items, and Program.cs gains a Comparer<T>.Create example. Four new tests cover the fixes.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit f3d839b into CodeMazeBlog:main Nov 9, 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