diff --git a/test/E2ETests/Smoke.E2E.Tests/SuiteLifeCycleTests.cs b/test/E2ETests/Smoke.E2E.Tests/SuiteLifeCycleTests.cs index 9488b3d8b3..2306f26dc9 100644 --- a/test/E2ETests/Smoke.E2E.Tests/SuiteLifeCycleTests.cs +++ b/test/E2ETests/Smoke.E2E.Tests/SuiteLifeCycleTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Collections.Generic; using System.Linq; using FluentAssertions; @@ -29,7 +31,39 @@ private void ValidateTestRunLifecycle(string targetFramework) var caseClassCleanup = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassCleanup.TestMethod")); caseClassCleanup.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassCleanup.Messages.Single().Text.Should().Be( + caseClassCleanup.Messages.Should().HaveCount(3); + caseClassCleanup.Messages[0].Text.Should().Be( + $""" + Console: AssemblyInit was called + Console: LifeCycleClassCleanup.ClassInitialize was called + Console: LifeCycleClassCleanup.ctor was called + Console: LifeCycleClassCleanup.TestInitialize was called + Console: LifeCycleClassCleanup.TestMethod was called + Console: LifeCycleClassCleanup.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanup.DisposeAsync was called\r\nConsole: LifeCycleClassCleanup.Dispose was called" + : "Console: LifeCycleClassCleanup.Dispose was called")} + + """); + caseClassCleanup.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("AssemblyInit was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanup.Dispose was called"))} + + """); + caseClassCleanup.Messages[2].Text.Should().Be( $""" @@ -51,7 +85,37 @@ LifeCycleClassCleanup.TestCleanup was called // We don't see "LifeCycleClassCleanupEndOfAssembly.ClassCleanup was called" because it will be attached to the // latest test run. - caseClassCleanupEndOfAssembly.Messages.Single().Text.Should().Be( + caseClassCleanupEndOfAssembly.Messages.Should().HaveCount(3); + caseClassCleanupEndOfAssembly.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfAssembly.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfAssembly.ctor was called + Console: LifeCycleClassCleanupEndOfAssembly.TestInitialize was called + Console: LifeCycleClassCleanupEndOfAssembly.TestMethod was called + Console: LifeCycleClassCleanupEndOfAssembly.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfAssembly.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfAssembly.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfAssembly.Dispose was called")} + + """); + caseClassCleanupEndOfAssembly.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssembly.Dispose was called"))} + + """); + caseClassCleanupEndOfAssembly.Messages[2].Text.Should().Be( $""" @@ -69,7 +133,39 @@ LifeCycleClassCleanupEndOfAssembly.TestCleanup was called var caseClassCleanupEndOfClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassCleanupEndOfClass.TestMethod")); caseClassCleanupEndOfClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassCleanupEndOfClass.Messages.Single().Text.Should().Be( + caseClassCleanupEndOfClass.Messages.Should().HaveCount(3); + caseClassCleanupEndOfClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfClass.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfClass.ctor was called + Console: LifeCycleClassCleanupEndOfClass.TestInitialize was called + Console: LifeCycleClassCleanupEndOfClass.TestMethod was called + Console: LifeCycleClassCleanupEndOfClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfClass.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfClass.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfClass.Dispose was called")} + Console: LifeCycleClassCleanupEndOfClass.ClassCleanup was called + + """); + caseClassCleanupEndOfClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.Dispose was called"))} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClass.ClassCleanup was called")} + + """); + caseClassCleanupEndOfClass.Messages[2].Text.Should().Be( $""" @@ -88,7 +184,37 @@ LifeCycleClassCleanupEndOfClass.ClassCleanup was called var caseClassInitializeAndCleanupBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod")); caseClassInitializeAndCleanupBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassInitializeAndCleanupBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseClassInitializeAndCleanupBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseClassInitializeAndCleanupBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called")} + + """); + caseClassInitializeAndCleanupBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called"))} + + """); + caseClassInitializeAndCleanupBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -106,7 +232,37 @@ LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called var caseClassInitializeAndCleanupNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassInitializeAndCleanupNone.TestMethod")); caseClassInitializeAndCleanupNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassInitializeAndCleanupNone.Messages.Single().Text.Should().Be( + caseClassInitializeAndCleanupNone.Messages.Should().HaveCount(3); + caseClassInitializeAndCleanupNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeAndCleanupNone.ClassInitialize was called + Console: LifeCycleClassInitializeAndCleanupNone.ctor was called + Console: LifeCycleClassInitializeAndCleanupNone.TestInitialize was called + Console: LifeCycleClassInitializeAndCleanupNone.TestMethod was called + Console: LifeCycleClassInitializeAndCleanupNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeAndCleanupNone.Dispose was called" + : "Console: LifeCycleClassInitializeAndCleanupNone.Dispose was called")} + + """); + caseClassInitializeAndCleanupNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.Dispose was called"))} + + """); + caseClassInitializeAndCleanupNone.Messages[2].Text.Should().Be( $""" @@ -124,7 +280,37 @@ LifeCycleClassInitializeAndCleanupNone.TestCleanup was called var caseClassInitializeBeforeEachDerivedClassAndClassCleanupNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone")); caseClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages.Single().Text.Should().Be( + caseClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages.Should().HaveCount(3); + caseClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called" + : "Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called")} + + """); + caseClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called"))} + + """); + caseClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages[2].Text.Should().Be( $""" @@ -142,7 +328,37 @@ LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup wa var caseClassInitializeNoneAndClassCleanupBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass")); caseClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called")} + + """); + caseClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called"))} + + """); + caseClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -160,7 +376,45 @@ LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup wa var caseDerivedClassInitializeAndCleanupBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.DerivedClassTestMethod")); caseDerivedClassInitializeAndCleanupBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassInitializeAndCleanupBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called"))} + + """); + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -183,7 +437,41 @@ LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called // Test the parent test method. var caseDerivedClassInitializeAndCleanupBeforeEachDerivedClassParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod")); caseDerivedClassInitializeAndCleanupBeforeEachDerivedClassParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassInitializeAndCleanupBeforeEachDerivedClassParentTestMethod.Messages.Single().Text.Should().Be( + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClassParentTestMethod.Messages.Should().HaveCount(3); + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClassParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClassParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called"))} + + """); + caseDerivedClassInitializeAndCleanupBeforeEachDerivedClassParentTestMethod.Messages[2].Text.Should().Be( $""" @@ -203,7 +491,43 @@ LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called var caseDerivedClassInitializeAndCleanupNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeAndCleanupNone.DerivedClassTestMethod")); caseDerivedClassInitializeAndCleanupNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassInitializeAndCleanupNone.Messages.Single().Text.Should().Be( + caseDerivedClassInitializeAndCleanupNone.Messages.Should().HaveCount(3); + caseDerivedClassInitializeAndCleanupNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleDerivedClassInitializeAndCleanupNone.ClassInitialize was called + Console: LifeCycleClassInitializeAndCleanupNone.ctor was called + Console: LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called + Console: LifeCycleClassInitializeAndCleanupNone.TestInitialize was called + Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called + Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestMethod was called + Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called + Console: LifeCycleClassInitializeAndCleanupNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeAndCleanupNone.Dispose was called" + : "Console: LifeCycleClassInitializeAndCleanupNone.Dispose was called")} + + """); + caseDerivedClassInitializeAndCleanupNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.Dispose was called"))} + + """); + caseDerivedClassInitializeAndCleanupNone.Messages[2].Text.Should().Be( $""" @@ -225,7 +549,41 @@ LifeCycleClassInitializeAndCleanupNone.TestCleanup was called // Test the parent test method. var caseDerivedClassInitializeAndCleanupNoneParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeAndCleanupNone.TestMethod")); caseDerivedClassInitializeAndCleanupNoneParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassInitializeAndCleanupNoneParentTestMethod.Messages.Single().Text.Should().Be( + caseDerivedClassInitializeAndCleanupNoneParentTestMethod.Messages.Should().HaveCount(3); + caseDerivedClassInitializeAndCleanupNoneParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeAndCleanupNone.ctor was called + Console: LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called + Console: LifeCycleClassInitializeAndCleanupNone.TestInitialize was called + Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called + Console: LifeCycleClassInitializeAndCleanupNone.TestMethod was called + Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called + Console: LifeCycleClassInitializeAndCleanupNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeAndCleanupNone.Dispose was called" + : "Console: LifeCycleClassInitializeAndCleanupNone.Dispose was called")} + + """); + caseDerivedClassInitializeAndCleanupNoneParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeAndCleanupNone.Dispose was called"))} + + """); + caseDerivedClassInitializeAndCleanupNoneParentTestMethod.Messages[2].Text.Should().Be( $""" @@ -245,7 +603,45 @@ LifeCycleClassInitializeAndCleanupNone.TestCleanup was called var caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DerivedClassTestMethod")); caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages.Single().Text.Should().Be( + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages.Should().HaveCount(3); + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called" + : "Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called")} + + """); + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called"))} + + """); + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Messages[2].Text.Should().Be( $""" @@ -268,7 +664,41 @@ LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup wa // Test the parent test method. var caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNoneParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod")); caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNoneParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNoneParentTestMethod.Messages.Single().Text.Should().Be( + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNoneParentTestMethod.Messages.Should().HaveCount(3); + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNoneParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called + Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called + Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called" + : "Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called")} + + """); + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNoneParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called"))} + + """); + caseDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNoneParentTestMethod.Messages[2].Text.Should().Be( $""" @@ -288,7 +718,43 @@ LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup wa var caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DerivedClassTestMethod")); caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called"))} + + """); + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -309,7 +775,37 @@ LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup wa var caseClassCleanupEndOfAssemblyAndBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod")); caseClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called")} + + """); + caseClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called"))} + + """); + caseClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -327,7 +823,37 @@ LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was call var caseClassCleanupEndOfAssemblyAndNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod")); caseClassCleanupEndOfAssemblyAndNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassCleanupEndOfAssemblyAndNone.Messages.Single().Text.Should().Be( + caseClassCleanupEndOfAssemblyAndNone.Messages.Should().HaveCount(3); + caseClassCleanupEndOfAssemblyAndNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called")} + + """); + caseClassCleanupEndOfAssemblyAndNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called"))} + + """); + caseClassCleanupEndOfAssemblyAndNone.Messages[2].Text.Should().Be( $""" @@ -345,7 +871,39 @@ LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called var caseClassCleanupEndOfClassAndBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod")); caseClassCleanupEndOfClassAndBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called")} + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called + + """); + caseClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called"))} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called")} + + """); + caseClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -364,7 +922,39 @@ LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called var caseClassCleanupEndOfClassAndNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleClassCleanupEndOfClassAndNone.TestMethod")); caseClassCleanupEndOfClassAndNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseClassCleanupEndOfClassAndNone.Messages.Single().Text.Should().Be( + caseClassCleanupEndOfClassAndNone.Messages.Should().HaveCount(3); + caseClassCleanupEndOfClassAndNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfClassAndNone.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndNone.ctor was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called")} + Console: LifeCycleClassCleanupEndOfClassAndNone.ClassCleanup was called + + """); + caseClassCleanupEndOfClassAndNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.Dispose was called"))} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.ClassCleanup was called")} + + """); + caseClassCleanupEndOfClassAndNone.Messages[2].Text.Should().Be( $""" @@ -383,7 +973,43 @@ LifeCycleClassCleanupEndOfClassAndNone.ClassCleanup was called var caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DerivedClassTestMethod")); caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -404,7 +1030,43 @@ LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was call var caseDerivedClassCleanupEndOfAssemblyAndNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.DerivedClassTestMethod")); caseDerivedClassCleanupEndOfAssemblyAndNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfAssemblyAndNone.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfAssemblyAndNone.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfAssemblyAndNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfAssemblyAndNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfAssemblyAndNone.Messages[2].Text.Should().Be( $""" @@ -424,7 +1086,43 @@ LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called """); var caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.DerivedClassTestMethod")); caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.Messages[2].Text.Should().Be( $""" @@ -445,7 +1143,43 @@ LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called var caseDerivedClassCleanupEndOfClassAndNone = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfClassAndNone.DerivedClassTestMethod")); caseDerivedClassCleanupEndOfClassAndNone.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfClassAndNone.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfClassAndNone.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfClassAndNone.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndNone.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfClassAndNone.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfClassAndNone.Messages[2].Text.Should().Be( $""" @@ -466,7 +1200,41 @@ LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called var caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClassParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod")); caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClassParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClassParentTestMethod.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClassParentTestMethod.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClassParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClassParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClassParentTestMethod.Messages[2].Text.Should().Be( $""" @@ -486,7 +1254,41 @@ LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was call var caseDerivedClassCleanupEndOfAssemblyAndNoneParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestMethod")); caseDerivedClassCleanupEndOfAssemblyAndNoneParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfAssemblyAndNoneParentTestMethod.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfAssemblyAndNoneParentTestMethod.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfAssemblyAndNoneParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called + Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfAssemblyAndNoneParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfAssemblyAndNoneParentTestMethod.Messages[2].Text.Should().Be( $""" @@ -505,7 +1307,41 @@ LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called """); var caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClassParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod")); caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClassParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClassParentTestMethod.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClassParentTestMethod.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClassParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClassParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfClassAndBeforeEachDerivedClassParentTestMethod.Messages[2].Text.Should().Be( $""" @@ -525,7 +1361,41 @@ LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called var caseDerivedClassCleanupEndOfClassAndNoneParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestMethod")); caseDerivedClassCleanupEndOfClassAndNoneParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - caseDerivedClassCleanupEndOfClassAndNoneParentTestMethod.Messages.Single().Text.Should().Be( + caseDerivedClassCleanupEndOfClassAndNoneParentTestMethod.Messages.Should().HaveCount(3); + caseDerivedClassCleanupEndOfClassAndNoneParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassCleanupEndOfClassAndNone.ctor was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called + Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called + Console: LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called\r\nConsole: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called" + : "Console: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called")} + + """); + caseDerivedClassCleanupEndOfClassAndNoneParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassCleanupEndOfClassAndNone.Dispose was called"))} + + """); + caseDerivedClassCleanupEndOfClassAndNoneParentTestMethod.Messages[2].Text.Should().Be( $""" @@ -548,64 +1418,101 @@ LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called // here as this is the last test to run. var caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod = RunEventsHandler.PassedTests.Single(x => x.TestCase.FullyQualifiedName.Contains("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod")); caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod.Outcome.Should().Be(Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome.Passed); - var caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText = caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod.Messages.Single().Text; - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - $""" - - - TestContext Messages: - LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called - LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called - LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called - LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called - LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called - LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called - LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called - {(targetFramework == "net6.0" - ? "LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nLifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called" - : "LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called")} - """); - var numberOfLines = caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Split('\n').Length; - Verify(numberOfLines == (targetFramework == "net6.0" ? 31 : 30)); // The number of the logs + 3 empty lines + 1 for the logs' header. + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod.Messages.Should().HaveCount(3); // Locally, netfx calls seems to be respecting the order of the cleanup while it is not stable for netcore. - // But local order is not the same on various machines. I am not sure whether we should be commiting to a + // But local order is not the same on various machines. I am not sure whether we should be committing to a // specific order. - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassCleanup.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassInitializeAndCleanupNone.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassInitializeAndCleanupNone.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "LifeCycleClassCleanupEndOfAssembly.ClassCleanup was called"); - caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethodMessageText.Should().Contain( - "AssemblyCleanup was called"); + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod.Messages[0].Text.Should().Be( + $""" + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called + Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called + Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nConsole: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called" + : "Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called")} + + """); + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod.Messages[1].Text.Should().Be( + $""" + + + Debug Trace: + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called")} + {GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called")} + {(targetFramework == "net6.0" + ? GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called") + + "\r\n" + + GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called") + : GenerateTraceDebugPrefixedMessage("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called"))} + + """); + + var expectedStart = + $""" + + + TestContext Messages: + LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called + LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called + LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called + LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called + LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called + LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called + LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called + {(targetFramework == "net6.0" + ? "LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called\r\nLifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called" + : "LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called")} + + """; + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod.Messages[2].Text.Should().StartWith(expectedStart); + var expectedRemainingMessages = new List + { + "LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassCleanup was called", + "LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassCleanup was called", + "LifeCycleClassCleanupEndOfAssemblyAndNone.ClassCleanup was called", + "LifeCycleClassCleanup.ClassCleanup was called", + "LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleDerivedClassInitializeAndCleanupNone.ClassCleanup was called", + "LifeCycleClassInitializeAndCleanupNone.ClassCleanup was called", + "LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called", + "LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called", + "LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called", + "LifeCycleClassCleanupEndOfAssembly.ClassCleanup was called", + "AssemblyCleanup was called", + string.Empty, + }; + + caseDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClassParentTestMethod + .Messages[2].Text + .Substring(expectedStart.Length) + .Split(new[] { "\r\n" }, StringSplitOptions.None) + .Should().BeEquivalentTo(expectedRemainingMessages); + } + + private string GenerateTraceDebugPrefixedMessage(string message) + { + string prefixedMessage = $"Trace: {message}"; + +#if DEBUG + prefixedMessage = $"{prefixedMessage}\r\nDebug: {message}"; +#endif + + return prefixedMessage; } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleAssemblyInitializeAndCleanup.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleAssemblyInitializeAndCleanup.cs index ca3687b8cf..c9041c70d9 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleAssemblyInitializeAndCleanup.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleAssemblyInitializeAndCleanup.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -15,11 +18,17 @@ public static void AssemblyInit(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("AssemblyInit was called"); + Console.WriteLine("Console: AssemblyInit was called"); + Trace.WriteLine("Trace: AssemblyInit was called"); + Debug.WriteLine("Debug: AssemblyInit was called"); } [AssemblyCleanup] public static void AssemblyCleanup() { s_testContext.WriteLine("AssemblyCleanup was called"); + Console.WriteLine("Console: AssemblyCleanup was called"); + Trace.WriteLine("Trace: AssemblyCleanup was called"); + Debug.WriteLine("Debug: AssemblyCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanup.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanup.cs index 08a6f12afa..40220b4c3f 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanup.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanup.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public sealed class LifeCycleClassCleanup : IDisposable public LifeCycleClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanup.ctor was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.ctor was called"); } [ClassInitialize] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassCleanup.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassCleanup.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassCleanup.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassCleanup.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassCleanup.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassCleanup.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanup.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanup.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanup.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanup.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssembly.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssembly.cs index 8208b45338..1ea3fefb41 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssembly.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssembly.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public sealed class LifeCycleClassCleanupEndOfAssembly : IDisposable public LifeCycleClassCleanupEndOfAssembly() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.ctor was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.ctor was called"); } [ClassInitialize] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssembly.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssembly.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssembly.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssembly.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs index 57c3c7c30f..7d0d7cae9a 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -13,7 +14,7 @@ namespace SuiteLifeCycleTestProject; [TestClass] public class LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass : IDisposable #if NET6_0_OR_GREATER - , IAsyncDisposable + , IAsyncDisposable #endif { private static TestContext s_testContext; @@ -23,6 +24,9 @@ public class LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass : IDisp public LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); } [ClassInitialize] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndNone.cs index 699163e489..c0e6e4b66b 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfAssemblyAndNone.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -13,7 +14,7 @@ namespace SuiteLifeCycleTestProject; [TestClass] public class LifeCycleClassCleanupEndOfAssemblyAndNone : IDisposable #if NET6_0_OR_GREATER - , IAsyncDisposable + , IAsyncDisposable #endif { private static TestContext s_testContext; @@ -23,6 +24,9 @@ public class LifeCycleClassCleanupEndOfAssemblyAndNone : IDisposable public LifeCycleClassCleanupEndOfAssemblyAndNone() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.ctor was called"); } [ClassInitialize] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClass.cs index 5c2983db6f..37ee95f873 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClass.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public sealed class LifeCycleClassCleanupEndOfClass : IDisposable public LifeCycleClassCleanupEndOfClass() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfClass.ctor was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.ctor was called"); } [ClassInitialize] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassCleanupEndOfClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClass.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClass.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.cs index be60722f19..5cb9778518 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public class LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass : IDisposa public LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); } [ClassInitialize] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndNone.cs index bfbc140a90..4b40f264ba 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassCleanupEndOfClassAndNone.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public class LifeCycleClassCleanupEndOfClassAndNone : IDisposable public LifeCycleClassCleanupEndOfClassAndNone() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.ctor was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.ctor was called"); } [ClassInitialize] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassCleanupEndOfClassAndNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassCleanupEndOfClassAndNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassCleanupEndOfClassAndNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassCleanupEndOfClassAndNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.cs index 4451380cce..fe9055c67c 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public class LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass : IDisposa public LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); } [ClassInitialize(InheritanceBehavior.BeforeEachDerivedClass)] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupNone.cs index 779ba94a85..8061ce99fb 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeAndCleanupNone.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public class LifeCycleClassInitializeAndCleanupNone : IDisposable public LifeCycleClassInitializeAndCleanupNone() { s_testContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.ctor was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.ctor was called"); } [ClassInitialize(InheritanceBehavior.None)] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassInitializeAndCleanupNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeAndCleanupNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeAndCleanupNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeAndCleanupNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs index 3e0bce2988..0b50b263de 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public class LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone : public LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone() { s_testContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); } [ClassInitialize(InheritanceBehavior.BeforeEachDerivedClass)] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs index 4f23a2e99f..91c898d931 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Diagnostics; #if NET6_0_OR_GREATER using System.Threading.Tasks; #endif @@ -23,6 +24,9 @@ public class LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass : public LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); } [ClassInitialize(InheritanceBehavior.None)] @@ -30,35 +34,53 @@ public static void ClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void TestInitialize() { TestContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void TestMethod() { TestContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void TestCleanup() { TestContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); } public void Dispose() { TestContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.Dispose was called"); } #if NET6_0_OR_GREATER public ValueTask DisposeAsync() { TestContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.DisposeAsync was called"); return ValueTask.CompletedTask; } #endif @@ -67,5 +89,8 @@ public ValueTask DisposeAsync() public static void ClassCleanup() { s_testContext.WriteLine("LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs index 15a9d3071f..d836891284 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -15,6 +18,9 @@ public sealed class LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerive public LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ctor was called"); } [ClassInitialize] @@ -22,29 +28,44 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndBeforeEachDerivedClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.cs index 710510b396..62b95bab86 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -15,6 +18,9 @@ public sealed class LifeCycleDerivedClassCleanupEndOfAssemblyAndNone : LifeCycle public LifeCycleDerivedClassCleanupEndOfAssemblyAndNone() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ctor was called"); } [ClassInitialize] @@ -22,29 +28,44 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfAssemblyAndNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.cs index 145faeaa24..b03078b4e9 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -15,6 +18,9 @@ public sealed class LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedCl public LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ctor was called"); } [ClassInitialize] @@ -22,29 +28,44 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndBeforeEachDerivedClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndNone.cs index 083173a9e3..2e0be93a90 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassCleanupEndOfClassAndNone.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -15,6 +18,9 @@ public sealed class LifeCycleDerivedClassCleanupEndOfClassAndNone : LifeCycleCla public LifeCycleDerivedClassCleanupEndOfClassAndNone() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndNone.ctor was called"); } [ClassInitialize] @@ -22,29 +28,44 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndNone.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassCleanupEndOfClassAndNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.cs index bfccb27e95..eab46be3c1 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -15,6 +18,9 @@ public sealed class LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedCl public LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ctor was called"); } [ClassInitialize] @@ -22,30 +28,45 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupBeforeEachDerivedClass.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupNone.cs index d33a037dd9..fbfcdbe06b 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeAndCleanupNone.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -15,6 +18,9 @@ public sealed class LifeCycleDerivedClassInitializeAndCleanupNone : LifeCycleCla public LifeCycleDerivedClassInitializeAndCleanupNone() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupNone.ctor was called"); } [ClassInitialize] @@ -22,29 +28,44 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupNone.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupNone.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupNone.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupNone.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeAndCleanupNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeAndCleanupNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeAndCleanupNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeAndCleanupNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs index 150615c41e..53c7479a06 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -16,6 +19,9 @@ public sealed class LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClas public LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ctor was called"); } [ClassInitialize] @@ -23,29 +29,44 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeBeforeEachDerivedClassAndClassCleanupNone.ClassCleanup was called"); } } diff --git a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs index 582eed079d..a87509ed3d 100644 --- a/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs +++ b/test/E2ETests/TestAssets/SuiteLifeCycleTestProject/LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; +using System.Diagnostics; + using Microsoft.VisualStudio.TestTools.UnitTesting; namespace SuiteLifeCycleTestProject; @@ -16,6 +19,9 @@ public sealed class LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEach public LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ctor was called"); } [ClassInitialize] @@ -23,29 +29,44 @@ public static void DerivedClassInitialize(TestContext testContext) { s_testContext = testContext; s_testContext.WriteLine("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassInitialize was called"); } [TestInitialize] public void DerivedClassTestInitialize() { TestContext.WriteLine("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestInitialize was called"); } [TestMethod] public void DerivedClassTestMethod() { TestContext.WriteLine("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestMethod was called"); } [TestCleanup] public void DerivedClassTestCleanup() { TestContext.WriteLine("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.TestCleanup was called"); } [ClassCleanup] public static void DerivedClassCleanup() { s_testContext.WriteLine("LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Console.WriteLine("Console: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Trace.WriteLine("Trace: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); + Debug.WriteLine("Debug: LifeCycleDerivedClassInitializeNoneAndClassCleanupBeforeEachDerivedClass.ClassCleanup was called"); } }