Skip to content

Commit 6bcef01

Browse files
committed
unittest fix
1 parent f6c87f1 commit 6bcef01

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

sandbox/SingleContainedApp/Program.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ public async Task Throw()
155155
}
156156
}
157157

158+
159+
public class SimpleTwoArgs : ConsoleAppBase
160+
{
161+
public void Hello(
162+
string name,
163+
int repeat)
164+
{
165+
Context.Logger.LogInformation($"name:{name}");
166+
Context.Logger.LogInformation($"repeat:{repeat}");
167+
}
168+
}
169+
158170
class Program
159171
{
160172
static async Task Main(string[] args)
@@ -167,7 +179,7 @@ await Host.CreateDefaultBuilder()
167179
{
168180
logging.SetMinimumLevel(LogLevel.Trace).ReplaceToSimpleConsole();
169181
})
170-
.RunConsoleAppFrameworkAsync<ThrowOperationCanceledException>(args);
182+
.RunConsoleAppFrameworkAsync<SimpleTwoArgs>(args);
171183
// .RunConsoleAppEngineAsync
172184
//.ConfigureServices((hostContext, services) =>
173185
//{

src/ConsoleAppFramework/ConsoleAppEngineHostBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ IHostBuilder ConfigureEmptyService()
143143
{
144144
if (!hasHelp)
145145
{
146-
Console.Write(new CommandHelpBuilder().BuildHelpMessage(methods, null));
146+
Console.Write(new CommandHelpBuilder().BuildHelpMessage(methods, defaultMethod));
147147
ConfigureEmptyService();
148148
return hostBuilder;
149149
}

0 commit comments

Comments
 (0)