public IEnumerable<string> NonApplicationPaths { get; }
- private static readonly char[] s_semicolon = new[] { ';' };
-
public DependencyContextPaths(
string? application,
string? sharedRuntime,
internal static DependencyContextPaths Create(string? depsFiles, string? sharedRuntime)
{
- string[]? files = depsFiles?.Split(s_semicolon, StringSplitOptions.RemoveEmptyEntries);
+#if NETCOREAPP
+ const char separator = ';';
+#else
+ // This method is only executed once at startup. No need to cache the char[].
+ char[] separator = { ';' };
+#endif
+ string[]? files = depsFiles?.Split(separator, StringSplitOptions.RemoveEmptyEntries);
string? application = files != null && files.Length > 0 ? files[0] : null;
string[]? nonApplicationPaths = files?
Subject.Fallbacks.Should().BeEquivalentTo("win7-x64", "win7-x86");
}
+ [Fact]
+ [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "GetEntryAssembly() returns null")]
+ public void DefaultWorksCorrectly()
+ {
+ // only need to assert the context contains non-null properties.
+
+ var context = DependencyContext.Default;
+ Assert.NotNull(context);
+ Assert.NotNull(context.RuntimeGraph);
+ Assert.NotNull(context.RuntimeLibraries);
+ Assert.NotNull(context.Target);
+ }
+
private TargetInfo CreateTargetInfo()
{
return new TargetInfo(