Table of Contents

Analyzers 1.10.0 2024 January 15

Today, we're shipping two new releases:

  • xUnit.net Core Framework v2 2.6.6 (release notes)
  • xUnit.net Analyzers 1.10.0

It's been 2 weeks since the release of 1.9.0.

As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉

Release Notes

These release notes are a comprehensive list of changes from 1.9.0 to 1.10.0.

Usage Analyzers

  • We have updated xUnit1030 and xUnit1031 to not report on code usage inside a local function in the unit test. xunit/xunit.analyzers#178

  • We have created xUnit1043 to flag an error when the developer uses a non-public constructor on a FactAttribute-derived class. While this is legal in the compiler, it fails at runtime due to being unsupported by the test framework. xunit/xunit#2120

Assertion Analyzers

  • We have updated xUnit2013 to stop reporting against StringValues. Calling Assert.Empty with an instance of StringValues calls the wrong overload because of an implicit cast from StringValues to string (and when the collection is empty, it returns a null string), so using something like Assert.Equal(0, stringValues.Count); is the preferred way to check for an empty StringValues collection. xunit/xunit#2859

  • We have created xUnit2028 to report warnings when using Assert.Empty or Assert.NotEmpty with either StringValues or ArraySegment<T>. Both collection types have problematic behavior that is explained in the documentation. xunit/xunit#2860