29 instantiations of TemplateSource
aspire (1)
Commands\NewCommand.cs (1)
548return await CreateFromSourceAsync(new TemplateSource(templatePath ?? ".", templateRepository, templateRepositoryRef), configSource, parseResult, cancellationToken);
Aspire.Cli.Tests (28)
Commands\NewCommandLocalTemplateTests.cs (13)
1330templateProvider.GetTemplatesAsync(new TemplateSource("template", null, null), new CancellationToken(canceled: true))); 1347var templates = await provider.GetRequiredService<ITemplateProvider>().GetTemplatesAsync(new TemplateSource("template", null, null)); 1561new TemplateSource("template", "https://example.test/templates.git", null), cancellation.Token)); 1592var first = Assert.Single(await templates.GetTemplatesAsync(new TemplateSource("template", "-repository", "main"))); 1601Assert.Single(await templates.GetTemplatesAsync(new TemplateSource("./template", "-repository", "v1"))); 1732new("one", "repository-a", "main"), 1733new("two", "repository-a", "main"), 1734new("one", "repository-b", "main"), 1735new("one", "repository-a", "changed") 1742Assert.Single(await templates.GetTemplatesAsync(new TemplateSource("./one", "repository-a", "same-commit-tag"))); 1749templates.GetTemplatesAsync(new TemplateSource("missing", "repository-a", "main"))); 1780var source = new TemplateSource("template", "repository", "main"); 1820var source = new TemplateSource("template", "repository", "missing");
Commands\NewCommandLocalTemplateTests.NuGetValues.cs (1)
428var templates = await provider.GetRequiredService<ITemplateProvider>().GetTemplatesAsync(new TemplateSource("template", null, null));
Templating\TemplateEngineFactoryGitCheckoutTests.cs (6)
29new TemplateSource(".", Path.GetRelativePath(workspace.WorkspaceRoot.FullName, repository.FullName), commit), 49Assert.Single(await factory.GetTemplatesAsync(new TemplateSource(".", repository.FullName, commit), TestContext.Current.CancellationToken)); 67Assert.Single(await factory.GetTemplatesAsync(new TemplateSource(".", repository.FullName, "same"), TestContext.Current.CancellationToken)); 69Assert.Single(await factory.GetTemplatesAsync(new TemplateSource(".", repository.FullName, "refs/tags/same"), TestContext.Current.CancellationToken)); 84new TemplateSource(".", Path.Combine(workspace.Path, "private-repository-secret-marker"), null), TestContext.Current.CancellationToken)); 107Assert.Single(await factory.GetTemplatesAsync(new TemplateSource(".", repository.FullName, commit), TestContext.Current.CancellationToken));
Templating\TemplateEngineFactoryGitTests.cs (8)
30new TemplateSource(".", "-repository with spaces", commit), TestContext.Current.CancellationToken); 59GetFactory(provider).GetTemplatesAsync(new TemplateSource(".", "repository", CommitSha), TestContext.Current.CancellationToken)); 80GetFactory(provider).GetTemplatesAsync(new TemplateSource(".", "repository", CommitSha), TestContext.Current.CancellationToken)); 95GetFactory(provider).GetTemplatesAsync(new TemplateSource(".", "repository", CommitSha), new CancellationToken(canceled: true))); 118GetFactory(provider).GetTemplatesAsync(new TemplateSource(".", "repository", resolving ? null : CommitSha), cancellation.Token)); 142GetFactory(provider).GetTemplatesAsync(new TemplateSource(".", "repository", CommitSha), TestContext.Current.CancellationToken)); 167GetFactory(provider).GetTemplatesAsync(new TemplateSource(".", "repository", null), TestContext.Current.CancellationToken)); 194var templates = await GetFactory(provider).GetTemplatesAsync(new TemplateSource(".", "repository", null), TestContext.Current.CancellationToken);
12 references to TemplateSource
aspire (7)
Commands\NewCommand.cs (1)
647private async Task<CommandResult> CreateFromSourceAsync(TemplateSource source, ConfigSource? configSource, ParseResult parseResult, CancellationToken cancellationToken)
Templating\CliTemplateFactory.cs (1)
115public Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default)
Templating\DotNetTemplateFactory.cs (1)
66public async Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default)
Templating\ITemplateFactory.cs (1)
19Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default);
Templating\ITemplateProvider.cs (1)
24Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default);
Templating\TemplateEngineFactory.cs (1)
48public async Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default)
Templating\TemplateProvider.cs (1)
28public async Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default)
Aspire.Cli.Tests (5)
Commands\NewCommandChannelResolutionTests.cs (1)
769public Task<IEnumerable<ITemplate>> GetTemplatesAsync(TemplateSource? source, CancellationToken cancellationToken = default) =>
Commands\NewCommandLocalTemplateTests.cs (4)
1730TemplateSource[] sources = 1737foreach (var source in sources) 1780var source = new TemplateSource("template", "repository", "main"); 1820var source = new TemplateSource("template", "repository", "missing");