Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -144,6 +145,14 @@ private static bool IsFactory<TReturn>(MethodInfo? factory)
{
return args =>
{
static bool IsApplicationNameArg(string arg)
=> arg.Equals("--applicationName", StringComparison.OrdinalIgnoreCase) ||
arg.Equals("/applicationName", StringComparison.OrdinalIgnoreCase);

args = args.Any(arg => IsApplicationNameArg(arg)) || assembly.FullName is null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is assembly.FullName null?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you're writing unit tests 😄

? args
: args.Concat(new[] { "--applicationName", assembly.FullName }).ToArray();

var host = hostFactory(args);
return GetServiceProvider(host);
};
Expand Down