This commit is contained in:
Youssef1313 2025-01-29 17:56:13 +01:00
Родитель 4955c00735
Коммит e2b90829fa
3 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -146,16 +146,19 @@ jobs:
parameters:
sdk: true
version: '6.0'
platform: $(BuildPlatform)
- template: steps-ensure-dotnet-version.yml
parameters:
sdk: true
version: '8.0'
platform: $(BuildPlatform)
- template: steps-ensure-dotnet-version.yml
parameters:
sdk: true
version: '9.0'
platform: $(BuildPlatform)
- ${{ if eq(parameters.runTests, true) }}:
- task: VisualStudioTestPlatformInstaller@1

Просмотреть файл

@ -5,6 +5,8 @@ parameters:
- name: sdk
type: boolean
default: false
- name: platform
type: string
# You might be wondering, "Why didn't they use UseDotNet?"
# Azure Pipelines is practically unmaintained, that's why.
@ -21,7 +23,7 @@ steps:
exit 1
}
$NEW_DOTNET_ROOT = "$(Agent.ToolsDirectory)\dotnet"
& ./dotnet-install.ps1 -Channel "${{parameters.version}}" -InstallDir $NEW_DOTNET_ROOT
& ./dotnet-install.ps1 -Channel "${{parameters.version}}" -Architecture ${{parameters.platform}} -InstallDir $NEW_DOTNET_ROOT
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT]${NEW_DOTNET_ROOT}"
Write-Host "##vso[task.prependpath]${NEW_DOTNET_ROOT}"
Remove-Item dotnet-install.ps1 -ErrorAction:Ignore

Просмотреть файл

@ -15,13 +15,14 @@ namespace UITests_FancyZonesEditor
public class RunFancyZonesEditorTest
{
private static FancyZonesEditorSession? _session;
private static TestContext? _context;
private readonly TestContext _context;
public RunFancyZonesEditorTest(TestContext context)
=> _context = context;
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
_context = testContext;
// prepare files to launch Editor without errors
EditorParameters editorParameters = new EditorParameters();
EditorParameters.ParamsWrapper parameters = new EditorParameters.ParamsWrapper
@ -133,19 +134,18 @@ namespace UITests_FancyZonesEditor
public static void ClassCleanup()
{
FancyZonesEditorSession.Files.Restore();
_context = null;
}
[TestInitialize]
public void TestInitialize()
{
_session = new FancyZonesEditorSession(_context!);
_session = new FancyZonesEditorSession(_context);
}
[TestCleanup]
public void TestCleanup()
{
_session?.Close(_context!);
_session?.Close(_context);
}
[TestMethod]