dotnet-installer/test/Microsoft.DotNet.Cli.Utils.Tests/GivenADefaultCommandResolver.cs
William Lee 08f050c012
bundled DotnetTool (#8606)
Extract packages to DotnetTools folder under sdk/{version}

Add new resolver to discover it

Add test to enforce package structure. It will fail when the structure
changed
2018-02-16 13:32:29 -08:00

37 lines
1.3 KiB
C#

// 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.Linq;
using FluentAssertions;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
namespace Microsoft.DotNet.Cli.Utils.Tests
{
public class GivenADefaultCommandResolver
{
[Fact]
public void It_contains_resolvers_in_the_right_order()
{
var defaultCommandResolver = DefaultCommandResolverPolicy.Create();
var resolvers = defaultCommandResolver.OrderedCommandResolvers;
resolvers.Should().HaveCount(8);
resolvers.Select(r => r.GetType())
.Should()
.ContainInOrder(
new []{
typeof(MuxerCommandResolver),
typeof(DotnetToolsCommandResolver),
typeof(RootedCommandResolver),
typeof(ProjectToolsCommandResolver),
typeof(AppBaseDllCommandResolver),
typeof(AppBaseCommandResolver),
typeof(PathCommandResolver),
typeof(PublishedPathCommandResolver)
});
}
}
}