Skip to content

Commit 9043c1b

Browse files
Sergio0694Copilot
andcommitted
Suppress MSTEST0003 for the private manual PnP helper in UnitTest
TestPnpPropertiesInLoop is a manual stress helper kept private so MSTest doesn't auto-run it (PnP enumeration is environment-dependent). The MSTest analyzer flags MSTEST0003 ('test method signature is invalid') because a [TestMethod] must be public. Keep the method private (preserving behavior - it is never auto-discovered) and the [TestMethod] for easy ad-hoc runs, wrapping it in a scoped pragma to suppress MSTEST0003 with an explanatory comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5df4f06 commit 9043c1b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Tests/UnitTest/TestComponentCSharp_Tests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4409,6 +4409,10 @@ public void TestEventRemovalByEventSource()
44094409
// }
44104410
//}
44114411

4412+
// 'TestPnpPropertiesInLoop' is a manual stress helper kept 'private' so MSTest doesn't auto-run it
4413+
// (PnP enumeration is environment-dependent). The '[TestMethod]' is retained for easy ad-hoc runs, so
4414+
// suppress MSTEST0003 ("test method signature is invalid") for this intentionally-private method.
4415+
#pragma warning disable MSTEST0003
44124416
[TestMethod]
44134417
private async Task TestPnpPropertiesInLoop()
44144418
{
@@ -4417,6 +4421,7 @@ private async Task TestPnpPropertiesInLoop()
44174421
await TestPnpPropertiesAsync();
44184422
}
44194423
}
4424+
#pragma warning restore MSTEST0003
44204425

44214426
private async Task TestPnpPropertiesAsync()
44224427
{

0 commit comments

Comments
 (0)