diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs index b172729f04..e64265b804 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AbortionTests.cs @@ -141,21 +141,11 @@ public async Task TestA() public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - // We expect the same semantic for Linux, the test setup is not cross and we're using specific - // Windows API because this gesture is not easy xplat. - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - yield break; - } - - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs index 6d28370da9..82fd4d1e0c 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AppDomainTests.cs @@ -174,12 +174,9 @@ public static IEnumerable GetData() public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SingleTestSourceCode .PatchCodeWithReplace("$TargetFramework$", TargetFrameworks.NetFramework[0]) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs index 6c42defb8f..106dbc0684 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AspireSdkTests.cs @@ -85,12 +85,9 @@ public void GetWebResourceRootReturnsOkStatusCode() public string AspireProjectPath => GetAssetPath(AspireProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AspireProjectName, AspireProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AspireProjectName, AspireProjectName, AspireSourceCode .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs index f82fd72139..262b31da65 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyCleanupTests.cs @@ -32,13 +32,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file AssemblyCleanupTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs index 71aa97d623..1a88ea9279 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/AssemblyResolverTests.cs @@ -28,13 +28,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.NetFramework) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file AssemblyResolverCrash.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs index 2ec5f2f69e..a67a1f382e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CancellationTests.cs @@ -134,13 +134,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestCancellation.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs index de3fb70906..34a4943016 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestSettingsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -30,15 +30,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPathWithMSTestRunSettings => GetAssetPath(ProjectNameWithMSTestRunSettings); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectNameWithMSTestRunSettings, ProjectNameWithMSTestRunSettings, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectNameWithMSTestRunSettings, ProjectNameWithMSTestRunSettings, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", ProjectNameWithMSTestRunSettings) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion) .PatchCodeWithReplace("$AppendSettings$", MSTestSettings)); - } private const string MSTestSettings = """ diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs index d190325882..1e5539de3a 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationMSTestV2SettingsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -30,15 +30,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPathWithMSTestV2RunSettings => GetAssetPath(ProjectNameWithMSTestV2RunSettings); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectNameWithMSTestV2RunSettings, ProjectNameWithMSTestV2RunSettings, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectNameWithMSTestV2RunSettings, ProjectNameWithMSTestV2RunSettings, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", ProjectNameWithMSTestV2RunSettings) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion) .PatchCodeWithReplace("$AppendSettings$", MSTestV2Settings)); - } private const string MSTestV2Settings = """ diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs index b60fa50777..23a4030f9b 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ConfigurationSettingsTests.cs @@ -86,15 +86,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion) .PatchCodeWithReplace("$AppendSettings$", string.Empty)); - } private const string SourceCode = """ #file $ProjectName$.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs index 0e6b1113ec..c1e9f894bb 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/CustomAttributesTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -29,13 +29,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string DuplicateTestMethodProjectPath => GetAssetPath(DuplicateTestMethodProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (DuplicateTestMethodProjectName, DuplicateTestMethodProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DuplicateTestMethodProjectName, DuplicateTestMethodProjectName, DuplicateTestMethodSourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string DuplicateTestMethodSourceCode = """ #file DuplicateTestMethodAttribute.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs index 5e05614e74..4d52c0f377 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeadlockTests.cs @@ -48,13 +48,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file DeadlockTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs index 08a2abdf66..53ecc51aaa 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DeploymentItemTests.cs @@ -103,13 +103,10 @@ public void TestMethod1() public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.NetFramework[0]) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs index ad6c1a0ef9..3015a87b4a 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DuplicateTestClassAttributeTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -29,13 +29,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string DuplicateTestClassProjectPath => GetAssetPath(DuplicateTestClassProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (DuplicateTestClassProjectName, DuplicateTestClassProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DuplicateTestClassProjectName, DuplicateTestClassProjectName, DuplicateTestClassSourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string DuplicateTestClassSourceCode = """ #file DuplicateTestClassAttribute.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs index b2d4f991ba..6803faee75 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/DynamicDataMethodTests.cs @@ -57,13 +57,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file DynamicDataMethodTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs index f191ad5c46..44caf5c15e 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/FrameworkOnlyTests.cs @@ -85,13 +85,10 @@ public void TestMethod1() public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs index eee0e3471a..fb5ae392c8 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/GenericTestMethodTests.cs @@ -80,13 +80,10 @@ Cannot create an instance of T\[] because Type\.ContainsGenericParameters is tru public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) { - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return ("GenericTestMethodTests", "GenericTestMethodTests", + public override (string ID, string Name, string Code) GetAssetsToGenerate() => ("GenericTestMethodTests", "GenericTestMethodTests", SourceGenericTestMethod .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceGenericTestMethod = """ #file GenericTestMethodTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs index e87af996ef..ed1b9f778c 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -128,13 +128,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file HelpInfo.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs index b7ebe3793b..bef076410f 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/IgnoreTests.cs @@ -112,13 +112,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestIgnore.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs index 4ebaf5e17e..724e547f35 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/InconclusiveTests.cs @@ -118,13 +118,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestInconclusive.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs index ddfe696468..0357c5d550 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LeakTests.cs @@ -26,13 +26,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file LeakTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs index 782a4bd2e6..69a198a052 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesTaskThreadingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -32,14 +32,11 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ParallelAttribute$", string.Empty) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs index b4fae8407c..d9c5cca4c4 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesValueTaskThreadingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -32,13 +32,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.Net) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs index 7b197fea34..b49f6e3c14 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleAttributesVoidThreadingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -32,13 +32,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs index 3e233f13e3..44e871701d 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleTests.cs @@ -82,13 +82,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file LifecycleTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs index 98d27425eb..94744fd188 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/LifecycleWithParallelAttributesTaskThreadingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -33,14 +33,11 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, AssemblyName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, AssemblyName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ParallelAttribute$", "[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)]") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs index 49ddd4443c..2d4c2aabaa 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs @@ -135,14 +135,11 @@ public async Task Test12() public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/OutputTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/OutputTests.cs index 0a2f3d678e..87a3c97e05 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/OutputTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/OutputTests.cs @@ -33,13 +33,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestOutput.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs index 855cea695c..f135ebf6fa 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataRowTests.cs @@ -34,13 +34,10 @@ private static async Task UsingDataRowThatDoesNotRoundTripUsingDataContractJsonS public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) { - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (DataRowAssetName, DataRowAssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DataRowAssetName, DataRowAssetName, SourceCodeDataRow .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCodeDataRow = """ #file DataRowTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs index 65f5892f0f..483527765c 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedDataSourceTests.cs @@ -65,13 +65,10 @@ private static async Task RunTestsAsync(string currentTfm, string assetName, boo public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) { - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (DataSourceAssetName, DataSourceAssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DataSourceAssetName, DataSourceAssetName, SourceCodeDataSource .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCodeDataSource = """ #file DataSource.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs index 41eab2f411..60dd4f5c2c 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ParameterizedTestTests.cs @@ -137,13 +137,10 @@ private static async Task RunTestsAsync(string currentTfm, string assetName, boo public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder) { - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (DynamicDataAssetName, DynamicDataAssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (DynamicDataAssetName, DynamicDataAssetName, SourceCodeDynamicData .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCodeDynamicData = """ #file DynamicData.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs index 770a7ba022..dbd4da49de 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/PlaywrightSdkTests.cs @@ -136,12 +136,9 @@ public async Task HomepageHasPlaywrightInTitleAndGetStartedLinkLinkingToTheIntro public string PlaywrightProjectPath => GetAssetPath(PlaywrightProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (PlaywrightProjectName, PlaywrightProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (PlaywrightProjectName, PlaywrightProjectName, PlaywrightSourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs index 54405e8e69..6b41287a86 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RetryTests.cs @@ -36,13 +36,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file RetryTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs index 2d484914f0..20fe8691c7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs @@ -96,13 +96,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestRunSettings.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs index f61b27a7f3..b51d71f437 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassCooperativeTimeoutTests.cs @@ -59,15 +59,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", AssetName) .PatchCodeWithReplace("$TimeoutAttribute$", ", Timeout(5000, CooperativeCancellation = true)") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file mta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs index f20122eb58..ea1f3ac056 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTests.cs @@ -59,15 +59,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", AssetName) .PatchCodeWithReplace("$TimeoutAttribute$", string.Empty) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file mta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs index 0b2ca0319c..9b932db03d 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestClassTimeoutTests.cs @@ -59,15 +59,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", AssetName) .PatchCodeWithReplace("$TimeoutAttribute$", ", Timeout(5000)") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file mta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs index 1874e424d8..cdaeb379c9 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodCooperativeTimeoutTests.cs @@ -62,15 +62,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", AssetName) .PatchCodeWithReplace("$TimeoutAttribute$", ", Timeout(5000, CooperativeCancellation = true)") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file mta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs index 4fab99426c..ccfbc1b175 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTests.cs @@ -62,15 +62,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", AssetName) .PatchCodeWithReplace("$TimeoutAttribute$", string.Empty) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file mta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs index 0669e76339..96749a3226 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STATestMethodTimeoutTests.cs @@ -62,15 +62,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", AssetName) .PatchCodeWithReplace("$TimeoutAttribute$", ", Timeout(5000)") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file mta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs index 90ef622cf8..df8527178c 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/STAThreadingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -68,15 +68,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, (SourceCode + ProgramFileSourceCode) .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchCodeWithReplace("$GenerateEntryPoint$", "false") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs index 08387d111c..bc107d8e33 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ServerModeTests.cs @@ -75,9 +75,7 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, CurrentMSTestSourceCode .PatchCodeWithReplace("$TargetFramework$", $"{TargetFrameworks.All.ToMSBuildTargetFrameworks()}") .PatchCodeWithReplace("$MicrosoftNETTestSdkVersion$", MicrosoftNETTestSdkVersion) @@ -85,6 +83,5 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. .PatchCodeWithReplace("$EnableMSTestRunner$", "true") .PatchCodeWithReplace("$OutputType$", "Exe") .PatchCodeWithReplace("$Extra$", string.Empty)); - } } } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs index 754b314da9..6d3569f085 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SynchronizationContextTests.cs @@ -45,13 +45,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file SynchronizationContextProject.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs index b38d74836a..baf14251f0 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestContextTests.cs @@ -85,13 +85,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestTestContext.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs index b335ac7385..b5ae31cefd 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs @@ -44,13 +44,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestDiscovery.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs index a6aca74dc1..fa710aa1ac 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs @@ -51,16 +51,9 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - // NOTE: The BaseClass asset is embedded as a subdirectory within the main asset to avoid - // parallel build conflicts. If they were separate assets, TestAssetFixtureBase would build - // them in parallel, but TestDiscoveryWarnings has a ProjectReference to TestDiscoveryWarningsBaseClass, - // causing both builds to write to the same files simultaneously (file locking errors). - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode.PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestDiscoveryWarnings.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs index 67682d5ce4..7f31acfca0 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestFilterTests.cs @@ -87,13 +87,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestFilter.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs index b2662026a5..29d101fbc5 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestRunParametersTests.cs @@ -39,13 +39,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestRunParameters.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs index 209743e275..0e87f421b6 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsInheritanceTests.cs @@ -58,13 +58,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs index 3b77629534..c36a0e1651 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextCultureFlowsTests.cs @@ -58,13 +58,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs index 17ba633939..0f18055f63 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadContextTests.cs @@ -125,13 +125,10 @@ public void TestMethod2() public string InitToTestProjectPath => GetAssetPath(InitToTestProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (InitToTestProjectName, InitToTestProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (InitToTestProjectName, InitToTestProjectName, InitToTestSourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs index a007045375..bb1a996b19 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ThreadingTests.cs @@ -78,15 +78,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchCodeWithReplace("$GenerateEntryPoint$", "true") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file sta.runsettings diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs index d3e7230498..f05652755d 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeCancellationTests.cs @@ -202,14 +202,11 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file $ProjectName$.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs index 79d62d9b1f..6bc8b552b7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutCooperativeTestMethodTests.cs @@ -80,15 +80,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchCodeWithReplace("$TimeoutExtraArgs$", ", CooperativeCancellation = true") .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file $ProjectName$.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs index 2684cc062c..3923cc0295 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutFromRunSettingsTests.cs @@ -90,15 +90,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchCodeWithReplace("$TimeoutAttribute$", string.Empty) .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file $ProjectName$.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs index 438c07dc6b..82a6f3afb7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTestMethodTests.cs @@ -80,15 +80,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchCodeWithReplace("$TimeoutExtraArgs$", string.Empty) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file $ProjectName$.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs index 3585b2c2e6..5958a3d9b3 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutTests.cs @@ -72,13 +72,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TimeoutTest.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs index 10a48ded38..99a539d2fd 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenCanceledTests.cs @@ -44,15 +44,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchCodeWithReplace("$TimeoutAttribute$", "[Timeout(60000)]") .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file $ProjectName$.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs index 48d6a9c149..6babcaa655 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TimeoutWhenExpiresTests.cs @@ -155,15 +155,12 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchCodeWithReplace("$TimeoutAttribute$", "[Timeout(1000)]") .PatchCodeWithReplace("$ProjectName$", ProjectName) .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file $ProjectName$.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs index 2943f72d25..feebbcf523 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrxReportTests.cs @@ -46,14 +46,11 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file MSTestTrxReport.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs index fd87953f65..2ed2171f62 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TupleDynamicDataTests.cs @@ -58,13 +58,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TupleDynamicDataTests.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs index 54ecbb6a4e..03a19b74d7 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ValueTaskTests.cs @@ -27,13 +27,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file TestValueTask.csproj diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs index b3a9d2f615..77f5c313ef 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WinUITests.cs @@ -30,19 +30,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string ProjectPath => GetAssetPath(ProjectName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - // WinUI is Windows-only :) - yield break; - } - - yield return (ProjectName, ProjectName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (ProjectName, ProjectName, SourceCode .PatchCodeWithReplace("$TargetFramework$", WinUITargetFramework) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)); - } private const string SourceCode = """ #file WinUITests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs index 68713b2182..41fbe30ea9 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/AbortionTests.cs @@ -140,20 +140,11 @@ internal class Capabilities : ITestFrameworkCapabilities public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - // We expect the same semantic for Linux, the test setup is not cross and we're using specific - // Windows API because this gesture is not easy xplat. - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - yield break; - } - - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() + => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs index b2aa908dfd..751891b9c6 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ConsoleTests.cs @@ -560,12 +560,9 @@ internal class Capabilities : ITestFrameworkCapabilities public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs index 259b52d09b..80c88b06d2 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs @@ -58,13 +58,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { private const string AssetName = "CrashDumpFixture"; - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } public string TargetAssetPath => GetAssetPath(AssetName); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs index e62a5a263d..4859b255ca 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashPlusHangDumpTests.cs @@ -60,13 +60,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } private const string Sources = """ #file CrashPlusHangDump.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs index 52d363b1e9..fb45f259ec 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CustomBannerTests.cs @@ -156,13 +156,10 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, CustomBannerTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs index 1a427bc1d2..03f36c212a 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DataConsumerThroughputTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -127,13 +127,10 @@ public Task IsEnabledAsync() public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } = null!; diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs index a66c565539..e292e66436 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs @@ -292,13 +292,10 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs index 00349cccf4..eb7b66fb0c 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/EnvironmentVariablesConfigurationProviderTests.cs @@ -187,13 +187,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs index dd67f22e1f..a733287649 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionRequestCompleteTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Microsoft.Testing.Platform.Acceptance.IntegrationTests; @@ -97,13 +97,10 @@ internal class Capabilities : ITestFrameworkCapabilities public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs index 4f4e26133f..87a28203ab 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExecutionTests.cs @@ -285,13 +285,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs index b14ea8c35f..1cd13953d3 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ExitOnProcessExitTests.cs @@ -161,13 +161,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs index 47acfea2cf..c9edc53e61 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ForwardCompatibilityTests.cs @@ -123,14 +123,11 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, ForwardCompatibilityTestCode .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$PreviousExtensionVersion$", PreviousExtensionVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs index 1daa8ffc9e..9b864782d9 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpOutputTests.cs @@ -35,13 +35,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } private const string Sources = """ #file HangDump.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs index 8449b3c0fa..7c31a3fab2 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpProcessTreeTests.cs @@ -31,13 +31,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } private const string Sources = """ #file HangDumpWithChild.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs index adb139ced3..f1600046a4 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HangDumpTests.cs @@ -182,13 +182,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } private const string Sources = """ #file HangDump.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs index 1861bfa08f..29e749a9fa 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs @@ -460,13 +460,10 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string AllExtensionsTargetAssetPath => GetAssetPath(AllExtensionsAssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AllExtensionsAssetName, AllExtensionsAssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AllExtensionsAssetName, AllExtensionsAssetName, AllExtensionsTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs index dddd21066c..74a6900b10 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -400,13 +400,10 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string NoExtensionTargetAssetPath => GetAssetPath(NoExtensionAssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (NoExtensionAssetName, NoExtensionAssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (NoExtensionAssetName, NoExtensionAssetName, NoExtensionTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs index ed7498e330..4673dc3290 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationFailingTests.cs @@ -117,13 +117,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string FailingAssetPath => GetAssetPath(FailingAssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (FailingAssetName, FailingAssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (FailingAssetName, FailingAssetName, FailingTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs index ff5ae25748..29e8902069 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/LocalizationTests.cs @@ -178,13 +178,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs index 528de217d2..c4abd9c203 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MaxFailedTestsExtensionTests.cs @@ -176,13 +176,10 @@ public Task StopTestExecutionAsync(CancellationToken cancellationToken) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.NetCurrent) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs index f3776e8d31..4574e544c0 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/NoBannerTests.cs @@ -126,13 +126,10 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, NoBannerTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs index a74623bbf7..5597b9ce58 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs @@ -209,13 +209,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. { public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } private const string TestCode = """ #file RetryFailedTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs index c3f6254533..a854f43b12 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/ServerLoggingTests.cs @@ -84,13 +84,10 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture. public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } private const string Sources = """ #file ServerLoggingTests.csproj diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs index 77ff118e29..27d066f6bd 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryDisabledTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Platform.Configurations; @@ -116,14 +116,11 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(WithoutTelemetry); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (WithoutTelemetry, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (WithoutTelemetry, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$TelemetryArg$", ", new TestApplicationOptions() { EnableTelemetry = false }")); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs index 301db49a0e..dea635ba32 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TelemetryTests.cs @@ -172,14 +172,11 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(WithTelemetry); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (WithTelemetry, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (WithTelemetry, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$TelemetryArg$", string.Empty)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs index b09d1975a2..13e935b465 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TestHostProcessLifetimeHandlerTests.cs @@ -133,13 +133,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs index c85a264d61..d56bbcc26e 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TimeoutTests.cs @@ -149,13 +149,10 @@ public Task ExecuteRequestAsync(ExecuteRequestContext context) public string NoExtensionTargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs index b24ba7fd15..a93234109e 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxDataRowTests.cs @@ -110,15 +110,12 @@ public void TestMethod1(string s) public string TargetAssetPath => GetAssetPath(WithDataRow); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (WithDataRow, AssetNameUsingMSTest, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (WithDataRow, AssetNameUsingMSTest, MSTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion) .PatchCodeWithReplace("$IgnoreTestAttributeOrNothing$", string.Empty)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs index 067990f55b..e63ce58f5c 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxFailingTestTests.cs @@ -130,13 +130,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(WithFailingTest); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (WithFailingTest, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (WithFailingTest, AssetName, FailingTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs index 0d2a6a76f7..7811e00c13 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxSkippedTestTests.cs @@ -116,15 +116,12 @@ public void TestMethod1(string s) public string TargetAssetPath => GetAssetPath(WithSkippedTest); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (WithSkippedTest, AssetNameUsingMSTest, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (WithSkippedTest, AssetNameUsingMSTest, MSTestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion) .PatchCodeWithReplace("$MSTestVersion$", MSTestVersion) .PatchCodeWithReplace("$IgnoreTestAttributeOrNothing$", "[Ignore]")); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs index 7f867b9c21..44fe89de66 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/TrxTests.cs @@ -262,13 +262,10 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, TestCode .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } public TestContext TestContext { get; set; } diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs index b1675e268f..82d7fe4712 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/UnhandledExceptionPolicyTests.cs @@ -284,12 +284,9 @@ public async Task ExecuteRequestAsync(ExecuteRequestContext context) public string TargetAssetPath => GetAssetPath(AssetName); - public override IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate() - { - yield return (AssetName, AssetName, + public override (string ID, string Name, string Code) GetAssetsToGenerate() => (AssetName, AssetName, Sources .PatchTargetFrameworks(TargetFrameworks.All) .PatchCodeWithReplace("$MicrosoftTestingPlatformVersion$", MicrosoftTestingPlatformVersion)); - } } } diff --git a/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs b/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs index 7529bba1c6..97e80cb3eb 100644 --- a/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs +++ b/test/Utilities/Microsoft.Testing.TestInfrastructure/TestAssetFixtureBase.cs @@ -32,25 +32,24 @@ public string GetAssetPath(string assetID) ? throw new ArgumentNullException(nameof(assetID), $"Cannot find target path for test asset '{assetID}'") : testAsset.TargetAssetPath; - public async Task InitializeAsync(CancellationToken cancellationToken) => - // Generate all projects into the same temporary base folder, but separate subdirectories, so we can reference one from other. - await Parallel.ForEachAsync(GetAssetsToGenerate(), async (asset, _) => - { - TestAsset testAsset = await TestAsset.GenerateAssetAsync(asset.ID, asset.Code, _tempDirectory); - DotnetMuxerResult result = await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath} -c Release", _nugetGlobalPackagesDirectory.Path, callerMemberName: asset.Name, cancellationToken: cancellationToken); - testAsset.DotnetResult = result; - _testAssets.TryAdd(asset.ID, testAsset); - }); + public async Task InitializeAsync(CancellationToken cancellationToken) + { + (string assetId, string assetName, string assetCode) = GetAssetsToGenerate(); + TestAsset testAsset = await TestAsset.GenerateAssetAsync(assetId, assetCode, _tempDirectory); + DotnetMuxerResult result = await DotnetCli.RunAsync($"build {testAsset.TargetAssetPath} -c Release", _nugetGlobalPackagesDirectory.Path, callerMemberName: assetName, cancellationToken: cancellationToken); + testAsset.DotnetResult = result; + _testAssets.TryAdd(assetId, testAsset); + } /// - /// Returns a list test assets to generate. A test asset has an id, name and code. A test asset is typically a project and all its files. Like MyTests.csproj, Program.cs, runsettings.runsettings etc. - /// The asset id determines the name of the sub-folder into which all those files will be placed, this id has to be unique within the collection returned by this method. + /// Returns a test asset to generate. A test asset has an id, name and code. A test asset is typically a project and all its files. Like MyTests.csproj, Program.cs, runsettings.runsettings etc. + /// The asset id determines the name of the sub-folder into which all those files will be placed. /// The asset name, identifies the file that will be built within that folder, this name does not have to be unique, so you can re-use similar sources in multiple assets, e.g. when one option needs to change /// but rest of the project remains the same. /// Code is the code that is split into separate files on the #file comments in the code. /// /// - public abstract IEnumerable<(string ID, string Name, string Code)> GetAssetsToGenerate(); + public abstract (string ID, string Name, string Code) GetAssetsToGenerate(); protected virtual void Dispose(bool disposing) {