Replace Assert.IsTrue(Contains) with Assert.Contains per MSTEST0037#146
Merged
Conversation
Agent-Logs-Url: https://github.com/demaconsulting/TestResults/sessions/4344d7b3-1384-4511-8512-b4c05d537b72 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Malcolmnixon
April 24, 2026 01:03
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses MSTEST0037 analyzer findings in the test suite by replacing Assert.IsTrue(x.Contains(...)) patterns with the idiomatic MSTest Assert.Contains(...) calls for substring checks.
Changes:
- Updated TRX serialization assertions in
IOTestsandTestResultsLibraryTeststo useAssert.Contains(...). - Updated JUnit serialization assertions in the same tests to use
Assert.Contains(...).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/DemaConsulting.TestResults.Tests/TestResultsLibraryTests.cs | Replaces Assert.IsTrue(content.Contains(...)) with Assert.Contains(...) in library end-to-end serialization tests. |
| test/DemaConsulting.TestResults.Tests/IO/IOTests.cs | Replaces Assert.IsTrue(content.Contains(...)) with Assert.Contains(...) in IO subsystem serialization tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Eight MSTEST0037 code smells across
IOTests.csandTestResultsLibraryTests.cswhereAssert.IsTrue(x.Contains(...))should use the idiomaticAssert.Contains(...).Type of Change
Related Issues
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration ReleaseCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
./lint.sh(Unix/macOS) orcmd /c lint.bat/./lint.bat(Windows)Testing
Documentation
Additional Notes
Mechanical change only — matches the
Assert.Contains(substring, value)pattern already used elsewhere in the test suite.