34 instantiations of TemplateCommand
Microsoft.TemplateEngine.Cli (2)
Commands\create\InstantiateCommand.cs (1)
435
TemplateCommand command =
new
(
Commands\create\InstantiateCommand.TabCompletion.cs (1)
56
TemplateCommand command =
new
(
Microsoft.TemplateEngine.Cli.UnitTests (32)
ParserTests\HelpTests.cs (17)
106
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
129
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
152
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
175
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
199
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
225
TemplateCommand templateCommand1 =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]);
226
TemplateCommand templateCommand2 =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]);
250
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
278
TemplateCommand templateCommand1 =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]);
279
TemplateCommand templateCommand2 =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]);
303
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
327
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
373
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
397
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
439
TemplateCommand templateCommand1 =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]);
440
TemplateCommand templateCommand2 =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]);
464
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
ParserTests\InstantiateTests.cs (9)
257
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
323
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
366
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
410
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
481
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
526
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
550
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
583
TemplateCommand templateCommand =
new
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
742
TemplateCommand templateCommand =
new
(
ParserTests\InstantiateTests.Subcommand.cs (5)
85
TemplateCommand templateCommand =
new
(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
148
TemplateCommand templateCommand =
new
(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
183
TemplateCommand templateCommand =
new
(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
226
TemplateCommand templateCommand =
new
(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
260
TemplateCommand templateCommand =
new
(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
ParserTests\TemplateCommandTests.cs (1)
52
_ = new
TemplateCommand
(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
97 references to TemplateCommand
Microsoft.TemplateEngine.Cli (37)
Commands\create\InstantiateCommand.cs (14)
82
internal static HashSet<
TemplateCommand
> GetTemplateCommand(
92
HashSet<
TemplateCommand
> candidates = ReparseForTemplate(
275
HashSet<
TemplateCommand
> candidates = GetTemplateCommand(args, environmentSettings, templatePackageManager, templateGroup);
278
TemplateCommand
templateCommandToRun = candidates.Single();
371
private static HashSet<
TemplateCommand
> ReparseForTemplate(
380
HashSet<
TemplateCommand
> candidates = new();
383
if (ReparseForTemplate(args, environmentSettings, templatePackageManager, templateGroup, template) is (
TemplateCommand
command, ParseResult parseResult))
396
private static HashSet<
TemplateCommand
> ReparseForDefaultLanguage(
401
HashSet<
TemplateCommand
> candidates)
403
HashSet<
TemplateCommand
> languageAwareCandidates = new();
404
foreach (
TemplateCommand
templateCommand in candidates)
412
validateDefaultLanguage: true) is (
TemplateCommand
command, ParseResult parseResult))
425
private static (
TemplateCommand
? Command, ParseResult? ParseResult)? ReparseForTemplate(
435
TemplateCommand
command = new(
Commands\create\InstantiateCommand.Help.cs (16)
54
IEnumerable<
TemplateCommand
> matchingTemplates =
72
out IEnumerable<
TemplateCommand
>? templatesToShow))
79
TemplateCommand
preferredTemplate = templatesToShow.OrderByDescending(x => x.Template.Precedence).First();
101
IEnumerable<
TemplateCommand
> matchingTemplates,
104
out IEnumerable<
TemplateCommand
>? filteredTemplates)
115
IEnumerable<
TemplateCommand
> templatesForDefaultLanguage = filteredTemplates.Where(c => string.Equals(c.Template.GetLanguage(), defaultLanguage, StringComparison.OrdinalIgnoreCase));
262
IEnumerable<
TemplateCommand
> templates,
285
IEnumerable<
TemplateCommand
> templatesToShow,
298
foreach (
TemplateCommand
template in templatesToShow)
306
foreach (
TemplateCommand
template in templatesToShow)
314
foreach (
TemplateCommand
template in templatesToShow)
334
internal static IEnumerable<
TemplateCommand
> GetMatchingTemplates(
340
List<
TemplateCommand
> matchingTemplates = new();
355
is (
TemplateCommand
command, ParseResult parseResult))
400
private static IEnumerable<TemplateOption> CollectOptionsToShow(IEnumerable<
TemplateCommand
> templates, HelpContext context)
407
foreach (
TemplateCommand
command in templates)
Commands\create\InstantiateCommand.NoMatchHandling.cs (1)
67
is (
TemplateCommand
command, ParseResult parseResult))
Commands\create\InstantiateCommand.TabCompletion.cs (1)
56
TemplateCommand
command = new(
Commands\create\TemplateCommandArgs.cs (2)
11
private readonly
TemplateCommand
_command;
14
public TemplateCommandArgs(
TemplateCommand
command, BaseCommand parentCommand, ParseResult parseResult)
Commands\create\TemplateResult.cs (3)
14
private readonly
TemplateCommand
_templateCommand;
18
private TemplateResult(
TemplateCommand
templateCommand, ParseResult parseResult)
40
internal static TemplateResult FromParseResult(
TemplateCommand
templateCommand, ParseResult parseResult)
Microsoft.TemplateEngine.Cli.UnitTests (60)
ParserTests\HelpTests.cs (17)
106
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
129
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
152
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
175
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
199
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
225
TemplateCommand
templateCommand1 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]);
226
TemplateCommand
templateCommand2 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]);
250
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
278
TemplateCommand
templateCommand1 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]);
279
TemplateCommand
templateCommand2 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]);
303
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
327
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
373
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
397
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
439
TemplateCommand
templateCommand1 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[0]);
440
TemplateCommand
templateCommand2 = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates[1]);
464
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
ParserTests\HelpTests.Resolution.cs (16)
31
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
56
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
86
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
89
Assert.True(InstantiateCommand.VerifyMatchingTemplates(settings, matchingTemplates, reporter, out IEnumerable<
TemplateCommand
>? filtered));
116
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
119
Assert.True(InstantiateCommand.VerifyMatchingTemplates(settings, matchingTemplates, reporter, out IEnumerable<
TemplateCommand
>? filtered));
142
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
145
Assert.True(InstantiateCommand.VerifyMatchingTemplates(settings, matchingTemplates, reporter, out IEnumerable<
TemplateCommand
>? filtered));
169
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
192
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
215
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
238
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
266
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
301
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
336
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
372
IEnumerable<
TemplateCommand
> matchingTemplates = InstantiateCommand.GetMatchingTemplates(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
ParserTests\InstantiateTests.cs (15)
229
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
257
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
323
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
366
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
410
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
481
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
526
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
550
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
583
TemplateCommand
templateCommand = new(myCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
615
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
644
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
675
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
705
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
742
TemplateCommand
templateCommand = new(
773
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
ParserTests\InstantiateTests.NoMatchHandling.cs (1)
304
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
ParserTests\InstantiateTests.Subcommand.cs (7)
54
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
85
TemplateCommand
templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
148
TemplateCommand
templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
183
TemplateCommand
templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
226
TemplateCommand
templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
260
TemplateCommand
templateCommand = new(instantiateCommand, settings, packageManager, templateGroup, templateGroup.Templates.Single());
286
HashSet<
TemplateCommand
> templateCommands = InstantiateCommand.GetTemplateCommand(args, settings, A.Fake<TemplatePackageManager>(), templateGroup);
ParserTests\MiscTests.cs (1)
32
Assert.Equal(aliases.OrderBy(a => a),
TemplateCommand
.KnownHelpAliases.OrderBy(a => a));
ParserTests\TemplateCommandTests.cs (3)
77
Assert.Empty(await
TemplateCommand
.ValidateConstraintsAsync(templateConstraintManager, template, default));
90
Assert.NotEmpty(await
TemplateCommand
.ValidateConstraintsAsync(templateConstraintManager, template, default));
102
Assert.NotEmpty(await
TemplateCommand
.ValidateConstraintsAsync(templateConstraintManager, template, default));