File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
tests/Aspire.Cli.Tests/Utils Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 11// Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
4+ using Aspire . Cli . Builds ;
45using Aspire . Cli . Certificates ;
56using Aspire . Cli . Commands ;
67using Aspire . Cli . Interaction ;
@@ -20,6 +21,7 @@ public static IServiceCollection CreateServiceCollection(Action<CliServiceCollec
2021 var services = new ServiceCollection ( ) ;
2122 services . AddLogging ( ) ;
2223
24+ services . AddSingleton ( options . AppHostBuilderFactory ) ;
2325 services . AddSingleton ( options . ProjectLocatorFactory ) ;
2426 services . AddSingleton ( options . InteractiveServiceFactory ) ;
2527 services . AddSingleton ( options . CertificateServiceFactory ) ;
@@ -38,6 +40,12 @@ public static IServiceCollection CreateServiceCollection(Action<CliServiceCollec
3840
3941internal sealed class CliServiceCollectionTestOptions
4042{
43+ public Func < IServiceProvider , IAppHostBuilder > AppHostBuilderFactory { get ; set ; } = ( IServiceProvider serviceProvider ) => {
44+ var logger = serviceProvider . GetRequiredService < ILogger < AppHostBuilder > > ( ) ;
45+ var runner = serviceProvider . GetRequiredService < IDotNetCliRunner > ( ) ;
46+ return new AppHostBuilder ( logger , runner ) ;
47+ } ;
48+
4149 public Func < IServiceProvider , INewCommandPrompter > NewCommandPrompterFactory { get ; set ; } = ( IServiceProvider serviceProvider ) =>
4250 {
4351 var interactionService = serviceProvider . GetRequiredService < IInteractionService > ( ) ;
You can’t perform that action at this time.
0 commit comments