diff --git a/Source/Test/SystematicTesting/TestMethodInfo.cs b/Source/Test/SystematicTesting/TestMethodInfo.cs index fba227c7a..551751714 100644 --- a/Source/Test/SystematicTesting/TestMethodInfo.cs +++ b/Source/Test/SystematicTesting/TestMethodInfo.cs @@ -12,6 +12,7 @@ using System.Runtime.Loader; #endif using System.Threading.Tasks; +using System.Xml.Linq; using Microsoft.Coyote.Actors; using Microsoft.Coyote.Logging; using Microsoft.Coyote.Runtime; @@ -444,9 +445,9 @@ private Assembly OnResolving(AssemblyLoadContext context, AssemblyName assemblyN runtimeLibrary.Dependencies, runtimeLibrary.Serviceable); if (this.AssemblyResolver.TryResolveAssemblyPaths(compilationLibrary, assemblies) && - assemblies.Count > 0) + assemblies.Any(a => string.Equals(Path.GetFileNameWithoutExtension(a), assemblyName.Name, StringComparison.OrdinalIgnoreCase))) { - return this.LoadContext.LoadFromAssemblyPath(assemblies[0]); + return this.LoadContext.LoadFromAssemblyPath(assemblies.First(a => string.Equals(Path.GetFileNameWithoutExtension(a), assemblyName.Name, StringComparison.OrdinalIgnoreCase))); } else {