Skip to content

Update MSTest to latest#1137

Merged
Sergio0694 merged 9 commits intomainfrom
dev/update-mestest
Nov 10, 2025
Merged

Update MSTest to latest#1137
Sergio0694 merged 9 commits intomainfrom
dev/update-mestest

Conversation

@Sergio0694
Copy link
Copy Markdown
Member

Title. Also applies all code fixes and addresses all warnings.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • Tested code with current supported SDKs
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Upgraded MSTest.TestAdapter and MSTest.TestFramework from version 3.11.0 to 4.0.1 across all unit test project files to ensure compatibility with the latest features and bug fixes.
Updated all unit tests to consistently use the expected value as the first argument in Assert.AreEqual calls. This improves readability and aligns with best practices for test assertions.
Replaces usages of Assert.AreEqual, Assert.IsTrue, and similar assertions with new helper methods such as Assert.HasCount, Assert.IsEmpty, Assert.IsNull, and Assert.IsGreaterThanOrEqualTo across multiple test files. This improves test readability and consistency with updated assertion APIs.
Updated all usages of Assert.HasCount to explicitly cast stream.Position to int. This ensures type consistency and prevents potential issues when stream.Position is a long.
Updated unit tests in Test_ObservableValidator.cs to use Assert.HasCount instead of Assert.AreEqual for collection count assertions. This improves clarity and consistency in test assertions.
Updated assertions in Test_RelayCommandAttribute_WithPartialCommandMethodDefinitions to assign results to the discard variable, improving code clarity and suppressing possible warnings about unused return values.
Replaces Assert.IsTrue(!...) with Assert.IsFalse(...) for clarity in the Test_ObservableValidator_ValidateReturn test.
Added the Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute to all MSTest-based unit test project files to enable parallel test execution. This change should improve test run performance by allowing tests to run concurrently.
Moved the ParallelizeAttribute configuration from individual test project files to the shared Community.Toolkit.Common.targets file. This centralizes the configuration and ensures all test projects run tests in parallel by default.
@Sergio0694 Sergio0694 added maintenance ⚙️ Some regular maintenance updates testing 🏗️ Issues or changes related to testing infrastructure labels Nov 10, 2025
@Sergio0694 Sergio0694 merged commit 3541038 into main Nov 10, 2025
9 checks passed
@Sergio0694 Sergio0694 deleted the dev/update-mestest branch November 10, 2025 19:54
This was referenced Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance ⚙️ Some regular maintenance updates testing 🏗️ Issues or changes related to testing infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant