Skip to content

Commit 6bed8dd

Browse files
youssef-backport-botCopilotYoussef1313
authored
[rel/3.9] Fix System.MissingMethodException for KeyValuePair Deconstruction (#5635)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
1 parent 73d9a17 commit 6bed8dd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -618,15 +618,15 @@ private async Task ExecuteTestsWithTestRunnerAsync(
618618
var testContextProperties = new Dictionary<string, object?>(capacity: 8);
619619

620620
// Add tcm properties.
621-
foreach ((TestProperty key, object? value) in tcmProperties)
621+
foreach (KeyValuePair<TestProperty, object?> kvp in tcmProperties)
622622
{
623-
testContextProperties[key.Id] = value;
623+
testContextProperties[kvp.Key.Id] = kvp.Value;
624624
}
625625

626626
// Add source level parameters.
627-
foreach ((string key, object value) in sourceLevelParameters)
627+
foreach (KeyValuePair<string, object> kvp in sourceLevelParameters)
628628
{
629-
testContextProperties[key] = value;
629+
testContextProperties[kvp.Key] = kvp.Value;
630630
}
631631

632632
return testContextProperties;

src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ private static List<DeploymentItem> GetDeploymentItems(IEnumerable deploymentIte
259259

260260
IList<DeploymentItem> result = new List<DeploymentItem>();
261261

262-
foreach ((string? key, string? value) in deploymentItemsData)
262+
foreach (KeyValuePair<string, string> kvp in deploymentItemsData)
263263
{
264-
AddDeploymentItem(result, new DeploymentItem(key, value));
264+
AddDeploymentItem(result, new DeploymentItem(kvp.Key, kvp.Value));
265265
}
266266

267267
return result;

0 commit comments

Comments
 (0)