using System.Collections.Generic; using CliFx.Domain; namespace CliFx.Tests.Internal { internal static class CommandHelper { public static TCommand ResolveCommand(CommandInput input, IReadOnlyDictionary environmentVariables) where TCommand : ICommand, new() { var schema = CommandSchema.TryResolve(typeof(TCommand))!; var instance = new TCommand(); schema.Bind(instance, input, environmentVariables); return instance; } public static TCommand ResolveCommand(CommandInput input) where TCommand : ICommand, new() => ResolveCommand(input, new Dictionary()); } }