AppDomainToolkit.UnitTests.AppDomainContextUnitTests.LoadAssemblyWithReferences_InternalReferences_LoadFrom C# (CSharp) Method

LoadAssemblyWithReferences_InternalReferences_LoadFrom() private method

        public void LoadAssemblyWithReferences_InternalReferences_LoadFrom()
        {
            using (var context = AppDomainContext.Create())
            {
                var prevNumAssemblies = context.LoadedAssemblies.Count();

                // Add the correct resolver path for the test dir.
                context.RemoteResolver.AddProbePath(Path.GetFullPath(InternalRefsAssemblyDir));
                var targetPath = Path.GetFullPath(InternalRefsAssemblyPath);
                var targets = context.LoadAssemblyWithReferences(LoadMethod.LoadFrom, targetPath);

                Assert.True(context.LoadedAssemblies.Count() > prevNumAssemblies);
                Assert.True(targets.Any(x => x.Location.Equals(targetPath)));
                Assert.True(targets.Any(x => x.FullName.Contains(InternalRefsAssemblyName)));
                Assert.True(targets.Any(x => x.FullName.Contains(AssemblyAName)));
                Assert.True(targets.Any(x => x.FullName.Contains(AssemblyBName)));
            }
        }