diff --git a/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs b/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs index fe29c5998e..77023f6088 100644 --- a/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs +++ b/src/Adapter/MSTest.TestAdapter/Execution/TestClassInfo.cs @@ -346,6 +346,11 @@ public void RunClassInitialize(TestContext testContext) internal UnitTestResult GetResultOrRunClassInitialize(ITestContext testContext, string initializationLogs, string initializationErrorLogs, string initializationTrace, string initializationTestContextMessages) { + if (IsClassInitializeExecuted) + { + return new UnitTestResult(ObjectModelUnitTestOutcome.Passed, null); + } + bool isSTATestClass = AttributeComparer.IsDerived(ClassAttribute); bool isWindowsOS = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); if (isSTATestClass diff --git a/src/Adapter/MSTest.TestAdapter/Execution/UnitTestRunner.cs b/src/Adapter/MSTest.TestAdapter/Execution/UnitTestRunner.cs index 6d6e854add..0e7b634464 100644 --- a/src/Adapter/MSTest.TestAdapter/Execution/UnitTestRunner.cs +++ b/src/Adapter/MSTest.TestAdapter/Execution/UnitTestRunner.cs @@ -160,15 +160,25 @@ internal UnitTestResult[] RunSingleTest(TestMethod testMethod, IDictionary