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 simplifies a minor inconsistency introduced as part of the file-split refactoring in #7940.
File Simplified
src/Platform/Microsoft.Testing.Platform/Messages/TimingProperties.cs — Removed redundant .ToString() call in TimingInfo.ToString()
Improvement Made
Removed redundant .ToString() call for consistency
StringBuilder.Append(Duration.ToString()) is functionally identical to StringBuilder.Append(Duration) — StringBuilder.Append already calls ToString() internally. The surrounding Append calls in the same method (StartTime, EndTime) already follow the concise form without explicit .ToString():
The patch file is available in the agent artifact in the workflow run linked above.
To create a pull request with the changes:
# Download the artifact from the workflow run
gh run download 25162414830 -n agent -D /tmp/agent-25162414830
# Create a new branch
git checkout -b simplify/timing-tostring-redundant-056b7c1c103ef825
# Apply the patch (--3way handles cross-repo patches where files may already exist)
git am --3way /tmp/agent-25162414830/aw-simplify-timing-tostring-redundant.patch
# Push the branch to origin
git push origin simplify/timing-tostring-redundant-056b7c1c103ef825
# Create the pull request
gh pr create --title '[code-simplifier] Remove redundant `.ToString()` in `TimingInfo.ToString()`' --base main --head simplify/timing-tostring-redundant-056b7c1c103ef825 --repo microsoft/testfx
Show patch (31 lines)
From 85b4c006d0317010d13ecd63d7ce67e36debe14e Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Thu, 30 Apr 2026 11:28:13 +0000
Subject: [PATCH] Remove redundant .ToString() in TimingInfo.Append call
StringBuilder.Append(Duration) is functionally identical to
StringBuilder.Append(Duration.ToString()) and consistent with
the other Append calls in the same method (StartTime, EndTime).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../Microsoft.Testing.Platform/Messages/TimingProperties.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Platform/Microsoft.Testing.Platform/Messages/TimingProperties.cs b/src/Platform/Microsoft.Testing.Platform/Messages/TimingProperties.cs
index aa13072..1457c0e 100644
--- a/src/Platform/Microsoft.Testing.Platform/Messages/TimingProperties.cs+++ b/src/Platform/Microsoft.Testing.Platform/Messages/TimingProperties.cs@@ -46,7 +46,7 @@ public override string ToString()
builder.Append($", {nameof(EndTime)} = ");
builder.Append(EndTime);
builder.Append($", {nameof(Duration)} = ");
- builder.Append(Duration.ToString());+ builder.Append(Duration);
builder.Append(" }");
return builder.ToString();
}
--
2.53.0
Code Simplification — 2026-04-30
This PR simplifies a minor inconsistency introduced as part of the file-split refactoring in #7940.
File Simplified
src/Platform/Microsoft.Testing.Platform/Messages/TimingProperties.cs— Removed redundant.ToString()call inTimingInfo.ToString()Improvement Made
Removed redundant
.ToString()call for consistencyStringBuilder.Append(Duration.ToString())is functionally identical toStringBuilder.Append(Duration)—StringBuilder.Appendalready callsToString()internally. The surroundingAppendcalls in the same method (StartTime,EndTime) already follow the concise form without explicit.ToString():This makes all three
Appendcalls inTimingInfo.ToString()consistent.Changes Based On
Recent changes from:
TestNodeProperties.csinto focused single-responsibility files #7940 — RefactorTestNodeProperties.csinto focused single-responsibility filesTesting
Automated by Code Simplifier Agent
Note
🔒 Integrity filter blocked 7 items
The following items were blocked because they don't meet the GitHub integrity level.
search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:Note
This was originally intended as a pull request, but the git push operation failed.
Workflow Run: View run details and download patch artifact
The patch file is available in the
agentartifact in the workflow run linked above.To create a pull request with the changes:
Show patch (31 lines)