public void IsMatchingNativeLibraryPositiveMatches(string os, string requestedFileName, string actualFileName) { Assert.True(NativeLibPathUtils.IsMatchingNativeLibrary( new FakeRuntimeEnvironment { OperatingSystem = os }, requestedFileName, actualFileName)); }
public void IsMatchingNativeLibraryNegativeMatches(string os, Platform platform, string requestedFileName, string actualFileName) { Assert.False(NativeLibPathUtils.IsMatchingNativeLibrary( new FakeRuntimeEnvironment { OperatingSystem = os, OperatingSystemPlatform = platform }, requestedFileName, actualFileName)); }
private IntPtr LoadUnamangedLibrary(string path, string name) { foreach (var nativeLibFullPath in Directory.EnumerateFiles(path)) { if (NativeLibPathUtils.IsMatchingNativeLibrary(RuntimeEnvironmentHelper.RuntimeEnvironment, name, Path.GetFileName(nativeLibFullPath))) { return(_loadContextAccessor.Default.LoadUnmanagedLibraryFromPath(nativeLibFullPath)); } } return(IntPtr.Zero); }