Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,9 @@ public static IEnumerable<int> 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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 = """
<mstest>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 = """
<mstestv2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading