You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR applies two project-convention fixes to source files that were added in recent pull requests, aligning them with the coding standards enforced in .editorconfig.
Files Simplified
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs — 3× String.Substring calls replaced with C# range operators
src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.DataSource.cs — == null null-check replaced with the is null pattern
Improvements Made
Range operators instead of Substring (MSTestTestNodeConverter.cs)
✅ MSTest.TestAdapter project builds with 0 errors (net9.0)
✅ MSTestAdapter.PlatformServices project builds with 0 errors (net9.0)
✅ No functional changes — behavior is identical (range operators and is null are equivalent)
Review Focus
Please verify:
Simplifications match .editorconfig conventions (IDE0057 range operator, is-null pattern)
No unintended behavioral changes (these are purely syntactic)
🤖 Automated content by GitHub Copilot. Generated by the Code Simplifier workflow. · 260.7 AIC · ⌖ 17.7 AIC · ⊞ 9.3K · [◷]( · ◷)
Add this agentic workflows to your repo
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/code-simplifier.md@main
expires on Jul 9, 2026, 1:56 PM UTC
Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch code-simplifier/range-operators-null-patterns-7bc8cb645c330a4b.
To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Show patch preview (62 of 62 lines)
From 01182c12bce657dca33d9433385105e734ec00b2 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Wed, 8 Jul 2026 13:53:57 +0000
Subject: [PATCH] style: use range operators and is-null pattern in new PR
files
Apply two project-convention improvements to files added in recent PRs:
- MSTestTestNodeConverter.cs (added in #9706): replace Substring calls
with range operators per csharp_style_prefer_range_operator = true
- TestMethodRunner.DataSource.cs (added in #9729): replace == null with
is null per the project's 'always use is null / is not null' rule
No behavioral change; builds verified to succeed with 0 errors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../TestingPlatformAdapter/MSTestTestNodeConverter.cs | 6 +++---
.../Execution/TestMethodRunner.DataSource.cs | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs
index 32f825b..c407fb6 100644
--- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs+++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs@@ -150,8 +150,8 @@ private static void AddTestMethodIdentifier(TestNode testNode, TestMethod testMe
parameterTypes ??= [];
int lastIndexOfDot = managedType.LastIndexOf('.');
- string @namespace = lastIndexOfDot == -1 ? string.Empty : managedType.Substring(0, lastIndexOfDot);- string typeName = lastIndexOfDot == -1 ? managedType : managedType.Substring(lastIndexOfDot + 1);+ string @namespace = lastIndexOfDot == -1 ? string.Empty : managedType[..lastIndexOfDot];+ string typeName = lastIndexOfDot == -1 ? managedType : managedType[(lastIndexOfDot + 1)..];
// AssemblyFullName and ReturnTypeFullName are not
... (truncated)
Code Simplification — 2026-07-08
This PR applies two project-convention fixes to source files that were added in recent pull requests, aligning them with the coding standards enforced in
.editorconfig.Files Simplified
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs— 3×String.Substringcalls replaced with C# range operatorssrc/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.DataSource.cs—== nullnull-check replaced with theis nullpatternImprovements Made
Range operators instead of
Substring(MSTestTestNodeConverter.cs).editorconfigsetscsharp_style_prefer_range_operator = true:warning(IDE0057)managedType.Substring(0, lastIndexOfDot)→managedType[..lastIndexOfDot]managedType.Substring(lastIndexOfDot + 1)→managedType[(lastIndexOfDot + 1)..]fullyQualifiedName.Substring(0, lastDotIndexBeforeOpenBracket)→fullyQualifiedName[..lastDotIndexBeforeOpenBracket]is null/is not nullnull checks (TestMethodRunner.DataSource.cs)is nulloris not nullinstead of== nullor!= null"if (dataRows == null)→if (dataRows is null)Changes Based On
Recent changes from:
MSTestTestNodeConverter.cs)TestMethodRunner.csinto focused partial-class files #9729 — SplitTestMethodRunner.csinto focused partial-class files (addedTestMethodRunner.DataSource.cs)Testing
MSTest.TestAdapterproject builds with 0 errors (net9.0)MSTestAdapter.PlatformServicesproject builds with 0 errors (net9.0)is nullare equivalent)Review Focus
Please verify:
.editorconfigconventions (IDE0057 range operator, is-null pattern)Add this agentic workflows to your repo
To install this agentic workflow, run
Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch
code-simplifier/range-operators-null-patterns-7bc8cb645c330a4b.Click here to create the pull request
To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Show patch preview (62 of 62 lines)