From e2871aed46a38243a92781ab0493df8342ec3d8b Mon Sep 17 00:00:00 2001 From: Azat Mukhametshin Date: Thu, 9 Jul 2026 10:07:52 +0200 Subject: [PATCH 1/5] Fix IndexOutOfRangeException in VSTestBridge BuildFilter UID escaping ContextAdapterBase.BuildFilter reconstructs a VSTest TestCaseFilter from a TestNodeUidListFilter (the by-UID selection IDEs send over the server protocol). Its hand-rolled escaper guarded the "is this char already escaped?" check with the node index (i) instead of the character index (k): it read currentTestNodeUid.Value[k - 1] while testing i - 1 < 0. For any node after the first (i > 0) whose first character (k == 0) is a filter operator, this evaluated Value[-1] and threw IndexOutOfRangeException, aborting the whole run. The same index confusion could also under-escape an operator that follows a literal backslash. Replace the loop with VSTest's canonical FilterHelper.Escape, which escapes every filter operator ('\ ( ) & | = ! ~') unconditionally -- exactly what a raw test-node UID needs -- removing the index bug. Add RunContextAdapterFilterTests covering BuildFilter output: FullyQualifiedName vs Id= selection, multi-node OR joining, runsettings/command-line filters, operator escaping, and the two regressions above (a later node starting with an operator no longer throws; backslash-then-operator escapes both characters). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ObjectModel/ContextAdapterBase.cs | 32 +-- .../RunContextAdapterFilterTests.cs | 213 ++++++++++++++++++ 2 files changed, 218 insertions(+), 27 deletions(-) create mode 100644 test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs diff --git a/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ContextAdapterBase.cs b/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ContextAdapterBase.cs index df6c1b34b34..ff7c703644f 100644 --- a/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ContextAdapterBase.cs +++ b/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/ObjectModel/ContextAdapterBase.cs @@ -152,33 +152,11 @@ private static void BuildFilter(TestNodeUid[] testNodesUid, StringBuilder filter TestNodeUid currentTestNodeUid = testNodesUid[i]; filter.Append("FullyQualifiedName="); - for (int k = 0; k < currentTestNodeUid.Value.Length; k++) - { - char currentChar = currentTestNodeUid.Value[k]; - switch (currentChar) - { - case '\\': - case '(': - case ')': - case '&': - case '|': - case '=': - case '!': - case '~': - // If the symbol is not escaped, add an escape character. - if (i - 1 < 0 || currentTestNodeUid.Value[k - 1] != '\\') - { - filter.Append('\\'); - } - - filter.Append(currentChar); - break; - - default: - filter.Append(currentChar); - break; - } - } + + // Use VSTest's canonical escaper rather than a hand-rolled loop. It escapes every filter + // operator ('\', '(', ')', '&', '|', '=', '!', '~') unconditionally, which is exactly what + // we need for a raw (un-escaped) test-node UID. + filter.Append(FilterHelper.Escape(currentTestNodeUid.Value)); } } } diff --git a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs new file mode 100644 index 00000000000..f6b377be0e0 --- /dev/null +++ b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Testing.Extensions.VSTestBridge.CommandLine; +using Microsoft.Testing.Extensions.VSTestBridge.ObjectModel; +using Microsoft.Testing.Platform.CommandLine; +using Microsoft.Testing.Platform.Extensions.Messages; +using Microsoft.Testing.Platform.Requests; +using Microsoft.VisualStudio.TestPlatform.ObjectModel; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; + +using Moq; + +namespace Microsoft.Testing.Extensions.VSTestBridge.UnitTests.ObjectModel; + +/// +/// Tests for the filter building logic in (exercised through +/// ), most notably the private BuildFilter method that turns a +/// coming from the server protocol into a VSTest +/// TestCaseFilter expression. +/// +[TestClass] +public sealed class RunContextAdapterFilterTests +{ + private const string EmptyRunSettings = +""" + + + + +"""; + + [TestMethod] + public void GetTestCaseFilter_WithSecondNodeContainingPipe_KeepsBothNodesAndEscapesPipe() + { + // A later node whose name contains '|' must be emitted as an escaped literal ('\|') so it + // stays part of its FullyQualifiedName value, while the '|' that joins the two clauses remains + // the OR operator. + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("Namespace.MyClass.MyTest", "PrintArg(\"as|\")")); + string res = GetFilterValue(adapter); + + Assert.AreEqual("(FullyQualifiedName=Namespace.MyClass.MyTest|FullyQualifiedName=PrintArg\\(\"as\\|\"\\))", res); + } + + [TestMethod] + public void GetTestCaseFilter_WithNopFilter_AndNoRunSettingsOrCommandLineFilter_ReturnsNull() + { + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, new NopFilter()); + + Assert.IsNull(adapter.GetTestCaseFilter(null, _ => null)); + } + + [TestMethod] + public void GetTestCaseFilter_WithSingleFullyQualifiedNameNode_BuildsFullyQualifiedNameFilter() + { + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("Namespace.MyClass.MyTest")); + + Assert.AreEqual("(FullyQualifiedName=Namespace.MyClass.MyTest)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithMultipleNodes_JoinsWithOrOperator() + { + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B.Test1", "C.D.Test2")); + + Assert.AreEqual("(FullyQualifiedName=A.B.Test1|FullyQualifiedName=C.D.Test2)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithGuidNode_BuildsIdFilter() + { + var guid = new Guid("12345678-1234-1234-1234-1234567890ab"); + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter(guid.ToString())); + + Assert.AreEqual($"(Id={guid})", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithMixedGuidAndNameNodes_BuildsIdAndFullyQualifiedNameFilters() + { + var guid = new Guid("12345678-1234-1234-1234-1234567890ab"); + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter(guid.ToString(), "A.B.Test")); + + Assert.AreEqual($"(Id={guid}|FullyQualifiedName=A.B.Test)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithSpecialCharactersInName_EscapesFilterOperators() + { + // The pipe, parentheses, ampersand, equals, bang, tilde and backslash are all TestCaseFilter + // operators and must be escaped so they are treated as literals (regression for tests whose + // display name contains such characters, e.g. NUnit [TestCase("as|")]). + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("Ns.PrintArg(\"as|\")")); + + Assert.AreEqual("(FullyQualifiedName=Ns.PrintArg\\(\"as\\|\"\\))", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithAllOperatorCharacters_EscapesEachOfThem() + { + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("a\\b(c)d&e|f=g!h~i")); + + Assert.AreEqual("(FullyQualifiedName=a\\\\b\\(c\\)d\\&e\\|f\\=g\\!h\\~i)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithRunSettingsTestCaseFilter_UsesRunSettingsFilter() + { + string runSettings = +""" + + + Category=Fast + + +"""; + RunContextAdapter adapter = CreateAdapter(runSettings, new NopFilter()); + + Assert.AreEqual("(Category=Fast)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithCommandLineFilter_UsesCommandLineFilter() + { + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, new NopFilter(), commandLineFilter: "Category=Slow"); + + Assert.AreEqual("(Category=Slow)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithRunSettingsAndNodeFilter_CombinesWithAndOperator() + { + string runSettings = +""" + + + Category=Fast + + +"""; + RunContextAdapter adapter = CreateAdapter(runSettings, CreateUidFilter("A.B.Test")); + + Assert.AreEqual("(Category=Fast) & (FullyQualifiedName=A.B.Test)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithRunSettingsAndCommandLineFilter_CombinesWithAndOperator() + { + string runSettings = +""" + + + Category=Fast + + +"""; + RunContextAdapter adapter = CreateAdapter(runSettings, new NopFilter(), commandLineFilter: "Priority=1"); + + Assert.AreEqual("(Category=Fast) & (Priority=1)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithSecondNodeStartingWithSpecialCharacter_DoesNotThrowAndEscapes() + { + // Regression: the "already-escaped" guard in BuildFilter used the node index (i) instead of + // the character index (k) when looking back at the previous character. For any node after the + // first (i > 0) whose first character (k == 0) is a filter operator, this evaluated + // Value[k - 1] == Value[-1] and threw IndexOutOfRangeException. + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B.Test", "(weird")); + + Assert.AreEqual("(FullyQualifiedName=A.B.Test|FullyQualifiedName=\\(weird)", GetFilterValue(adapter)); + } + + [TestMethod] + public void GetTestCaseFilter_WithBackslashFollowedBySpecialCharacter_EscapesBoth() + { + // Regression: the buggy "already-escaped" guard treated the operator following a literal + // backslash as if it were already escaped, so it emitted the operator un-escaped. A raw + // backslash in the name must be escaped to "\\" AND the following operator must still be + // escaped, otherwise the operator (e.g. '|') is parsed as an OR and the clause is split. + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B|C")); + + Assert.AreEqual("(FullyQualifiedName=A.B\\|C)", GetFilterValue(adapter)); + + RunContextAdapter adapterBackslash = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B\\|C")); + + Assert.AreEqual("(FullyQualifiedName=A.B\\\\\\|C)", GetFilterValue(adapterBackslash)); + } + + private static TestNodeUidListFilter CreateUidFilter(params string[] uids) + => new([.. uids.Select(uid => new TestNodeUid(uid))]); + + private static string GetFilterValue(RunContextAdapter adapter) + { + ITestCaseFilterExpression? filterExpression = adapter.GetTestCaseFilter(null, _ => null); + Assert.IsNotNull(filterExpression); + return filterExpression.TestCaseFilterValue; + } + + private static RunContextAdapter CreateAdapter(string runSettingsXml, ITestExecutionFilter filter, string? commandLineFilter = null) + { + var runSettings = new Mock(); + runSettings.Setup(x => x.SettingsXml).Returns(runSettingsXml); + + var commandLineOptions = new Mock(); + string[]? commandLineFilterArguments = commandLineFilter is null ? null : [commandLineFilter]; + commandLineOptions + .Setup(x => x.TryGetOptionArgumentList(TestCaseFilterCommandLineOptionsProvider.TestCaseFilterOptionName, out commandLineFilterArguments)) + .Returns(commandLineFilter is not null); + + return new RunContextAdapter(commandLineOptions.Object, runSettings.Object, filter); + } +} From dbf0ee910e419f59591c4eec58ea26953eaa377a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Thu, 9 Jul 2026 14:48:10 +0200 Subject: [PATCH 2/5] Add MatchTestCase round-trip tests for BuildFilter escaping Assert the built filter not only produces the expected escaped string but also actually matches (via ITestCaseFilterExpression.MatchTestCase) a test case whose FullyQualifiedName is exactly the escaped name and rejects others, guarding the full escape -> parse -> match path against a future parser-side regression. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../RunContextAdapterFilterTests.cs | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs index f6b377be0e0..fbf309ea3bd 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs @@ -187,6 +187,45 @@ public void GetTestCaseFilter_WithBackslashFollowedBySpecialCharacter_EscapesBot Assert.AreEqual("(FullyQualifiedName=A.B\\\\\\|C)", GetFilterValue(adapterBackslash)); } + [TestMethod] + public void GetTestCaseFilter_WithSpecialCharactersInName_RoundTripsAndMatchesOnlyExactName() + { + // Verify the full escape -> parse -> match path (not just the emitted string): a name full of + // filter operators must, once escaped, parse back to a filter that matches a test case whose + // FullyQualifiedName is exactly that name and rejects any other name. + const string name = "Ns.PrintArg(\"as|\")"; + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter(name)); + + Assert.IsTrue(MatchesFullyQualifiedName(adapter, name)); + Assert.IsFalse(MatchesFullyQualifiedName(adapter, "Ns.PrintArg(\"as\")")); + } + + [TestMethod] + public void GetTestCaseFilter_WithBackslashFollowedBySpecialCharacter_RoundTripsAndMatchesOnlyExactName() + { + // Regression guard for the round trip: if the backslash-then-operator sequence were under-escaped + // the parser would split the value at the operator, so the filter would no longer match the exact + // name (and might match a truncated one). + const string name = "A.B\\|C"; + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter(name)); + + Assert.IsTrue(MatchesFullyQualifiedName(adapter, name)); + Assert.IsFalse(MatchesFullyQualifiedName(adapter, "A.B")); + } + + [TestMethod] + public void GetTestCaseFilter_WithMultipleNodes_MatchesEitherNodeButNotOthers() + { + // The '|' joining the two clauses must stay an OR operator while a '|' inside a name stays a + // literal, so the filter matches each node's exact name (including the special-character one) and + // nothing else. + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B.Test1", "PrintArg(\"as|\")")); + + Assert.IsTrue(MatchesFullyQualifiedName(adapter, "A.B.Test1")); + Assert.IsTrue(MatchesFullyQualifiedName(adapter, "PrintArg(\"as|\")")); + Assert.IsFalse(MatchesFullyQualifiedName(adapter, "A.B.Test2")); + } + private static TestNodeUidListFilter CreateUidFilter(params string[] uids) => new([.. uids.Select(uid => new TestNodeUid(uid))]); @@ -197,6 +236,19 @@ private static string GetFilterValue(RunContextAdapter adapter) return filterExpression.TestCaseFilterValue; } + private static bool MatchesFullyQualifiedName(RunContextAdapter adapter, string fullyQualifiedName) + { + ITestCaseFilterExpression? filterExpression = adapter.GetTestCaseFilter(null, _ => null); + Assert.IsNotNull(filterExpression); + + var testCase = new TestCase(fullyQualifiedName, new Uri("executor://mstest"), "source.dll"); + return filterExpression.MatchTestCase( + testCase, + propertyName => string.Equals(propertyName, "FullyQualifiedName", StringComparison.OrdinalIgnoreCase) + ? fullyQualifiedName + : null); + } + private static RunContextAdapter CreateAdapter(string runSettingsXml, ITestExecutionFilter filter, string? commandLineFilter = null) { var runSettings = new Mock(); From 78405f9286754e71f1f4f1a71acd58dc8ab69920 Mon Sep 17 00:00:00 2001 From: Azat Mukhametshin Date: Thu, 9 Jul 2026 14:59:38 +0200 Subject: [PATCH 3/5] Address review feedback: split operator/backslash tests, add single-node and empty-list coverage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../RunContextAdapterFilterTests.cs | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs index fbf309ea3bd..c3a9056ac9f 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs @@ -58,6 +58,18 @@ public void GetTestCaseFilter_WithSingleFullyQualifiedNameNode_BuildsFullyQualif Assert.AreEqual("(FullyQualifiedName=Namespace.MyClass.MyTest)", GetFilterValue(adapter)); } + [TestMethod] + public void GetTestCaseFilter_WithEmptyNodeList_ThrowsOnEmptyGroup() + { + // An empty UID list is constructible and builds the empty group "()", which the VSTest filter + // parser rejects, so GetTestCaseFilter surfaces a format error. Pinning this guards the edge + // case now that this suite owns the filter-building coverage. + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter()); + + TestPlatformFormatException exception = Assert.ThrowsExactly(() => adapter.GetTestCaseFilter(null, _ => null)); + Assert.AreEqual("()", exception.FilterValue); + } + [TestMethod] public void GetTestCaseFilter_WithMultipleNodes_JoinsWithOrOperator() { @@ -159,6 +171,17 @@ public void GetTestCaseFilter_WithRunSettingsAndCommandLineFilter_CombinesWithAn Assert.AreEqual("(Category=Fast) & (Priority=1)", GetFilterValue(adapter)); } + [TestMethod] + public void GetTestCaseFilter_WithSingleNodeStartingWithSpecialCharacter_DoesNotThrowAndEscapes() + { + // Companion to the multi-node regression above, exhaustive over the index dimension: the + // single-node case (i == 0) never threw under the old code because the "i - 1 < 0" guard + // short-circuited before the bogus Value[k - 1] read. It must still escape the leading operator. + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("(weird")); + + Assert.AreEqual("(FullyQualifiedName=\\(weird)", GetFilterValue(adapter)); + } + [TestMethod] public void GetTestCaseFilter_WithSecondNodeStartingWithSpecialCharacter_DoesNotThrowAndEscapes() { @@ -171,6 +194,16 @@ public void GetTestCaseFilter_WithSecondNodeStartingWithSpecialCharacter_DoesNot Assert.AreEqual("(FullyQualifiedName=A.B.Test|FullyQualifiedName=\\(weird)", GetFilterValue(adapter)); } + [TestMethod] + public void GetTestCaseFilter_WithOperator_EscapesOperator() + { + // A bare operator ('|') in the name must be escaped so it stays a literal instead of being + // parsed as an OR that splits the clause. + RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B|C")); + + Assert.AreEqual("(FullyQualifiedName=A.B\\|C)", GetFilterValue(adapter)); + } + [TestMethod] public void GetTestCaseFilter_WithBackslashFollowedBySpecialCharacter_EscapesBoth() { @@ -178,10 +211,6 @@ public void GetTestCaseFilter_WithBackslashFollowedBySpecialCharacter_EscapesBot // backslash as if it were already escaped, so it emitted the operator un-escaped. A raw // backslash in the name must be escaped to "\\" AND the following operator must still be // escaped, otherwise the operator (e.g. '|') is parsed as an OR and the clause is split. - RunContextAdapter adapter = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B|C")); - - Assert.AreEqual("(FullyQualifiedName=A.B\\|C)", GetFilterValue(adapter)); - RunContextAdapter adapterBackslash = CreateAdapter(EmptyRunSettings, CreateUidFilter("A.B\\|C")); Assert.AreEqual("(FullyQualifiedName=A.B\\\\\\|C)", GetFilterValue(adapterBackslash)); From 1c4816359ab52263c36420c37ed3bf5fd2f52963 Mon Sep 17 00:00:00 2001 From: Azat Mukhametshin Date: Thu, 9 Jul 2026 15:42:56 +0200 Subject: [PATCH 4/5] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../ObjectModel/RunContextAdapterFilterTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs index c3a9056ac9f..09bb0581fae 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs @@ -4,7 +4,6 @@ using Microsoft.Testing.Extensions.VSTestBridge.CommandLine; using Microsoft.Testing.Extensions.VSTestBridge.ObjectModel; using Microsoft.Testing.Platform.CommandLine; -using Microsoft.Testing.Platform.Extensions.Messages; using Microsoft.Testing.Platform.Requests; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; From 22d9268c701cc7d6bc122bff5def04a533fb40a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Thu, 9 Jul 2026 19:16:39 +0200 Subject: [PATCH 5/5] Restore missing using directive to fix CS0246 build break TestNodeUid lives in Microsoft.Testing.Platform.Extensions.Messages; that using was removed as 'unused' but CreateUidFilter constructs TestNodeUid, so all TFMs failed to compile with CS0246. Re-add the directive in alphabetical order. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../ObjectModel/RunContextAdapterFilterTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs index 09bb0581fae..c3a9056ac9f 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/ObjectModel/RunContextAdapterFilterTests.cs @@ -4,6 +4,7 @@ using Microsoft.Testing.Extensions.VSTestBridge.CommandLine; using Microsoft.Testing.Extensions.VSTestBridge.ObjectModel; using Microsoft.Testing.Platform.CommandLine; +using Microsoft.Testing.Platform.Extensions.Messages; using Microsoft.Testing.Platform.Requests; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;