зеркало из https://github.com/dotnet/cli-lab.git
Fix build error on osx
Address build warning in test assembly
This commit is contained in:
Родитель
6d60e11a4a
Коммит
5300d380b5
|
@ -8,6 +8,7 @@ using System.CommandLine.Builder;
|
|||
using System.CommandLine.Invocation;
|
||||
using System.CommandLine.Parsing;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.DotNet.Tools.Uninstall.MacOs;
|
||||
using Microsoft.DotNet.Tools.Uninstall.Shared.BundleInfo;
|
||||
using Microsoft.DotNet.Tools.Uninstall.Shared.Commands;
|
||||
|
@ -231,7 +232,7 @@ namespace Microsoft.DotNet.Tools.Uninstall.Shared.Configs
|
|||
}
|
||||
AssignOptionsToCommand(ListCommand, ListAuxOptions);
|
||||
|
||||
var bundleCollector = RuntimeInfo.RunningOnWindows ? new RegistryQuery() as IBundleCollector : new FileSystemExplorer() as IBundleCollector;
|
||||
var bundleCollector = OperatingSystem.IsWindows() ? new RegistryQuery() as IBundleCollector : new FileSystemExplorer() as IBundleCollector;
|
||||
ListCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => ListCommandExec.Execute(bundleCollector)));
|
||||
DryRunCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => DryRunCommandExec.Execute(bundleCollector)));
|
||||
RemoveCommand.Handler = CommandHandler.Create(ExceptionHandler.HandleException(() => UninstallCommandExec.Execute(bundleCollector)));
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using Microsoft.DotNet.Tools.Uninstall.Tests.Attributes;
|
||||
using Microsoft.DotNet.Tools.Uninstall.Windows;
|
||||
|
@ -48,9 +49,12 @@ namespace Microsoft.DotNet.Tools.Uninstall.Tests.Windows
|
|||
[InlineData("Microsoft .NET SDK 5.0.100 (arm64)")]
|
||||
internal void TestIsNetCoreBundleAccept(string input)
|
||||
{
|
||||
RegistryQuery.IsNetCoreBundle(input, "0.0", "mockuninstall.exe", "0.0")
|
||||
.Should()
|
||||
.BeTrue();
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
RegistryQuery.IsNetCoreBundle(input, "0.0", "mockuninstall.exe", "0.0")
|
||||
.Should()
|
||||
.BeTrue();
|
||||
}
|
||||
}
|
||||
|
||||
[WindowsOnlyTheory]
|
||||
|
@ -58,9 +62,12 @@ namespace Microsoft.DotNet.Tools.Uninstall.Tests.Windows
|
|||
[InlineData("Microsoft .NET Core SDK - rc1 (x86)")]
|
||||
internal void TestGetBundleVersionReturnsNullOnInvalidDisplayNames(string displayName)
|
||||
{
|
||||
RegistryQuery.GetBundleVersion(displayName, string.Empty, string.Empty)
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
RegistryQuery.GetBundleVersion(displayName, string.Empty, string.Empty)
|
||||
.Should()
|
||||
.BeNull();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче