public IEnumerable<Assembly> LoadAssemblies(AbsoluteFolderPath assemblyFolder)
        {
            var assemblyResolveHandler = new AssemblyResolveHandler(assemblyFolder);

            Console.WriteLine("loading assemblies from " + assemblyFolder);

            List<string> assemblyPaths =
                Directory.EnumerateFiles(assemblyFolder, "*.exe")
                    .Union(Directory.EnumerateFiles(assemblyFolder, "*.dll")).ToList();

            Console.WriteLine("found assemblies:");
            foreach (var assemblyPath in assemblyPaths)
            {
                Console.WriteLine(assemblyPath);
            }

            IEnumerable<Assembly> assemblies = assemblyPaths.Select(Assembly.LoadFile).ToList();

            foreach (Assembly assembly in assemblies)
            {
                this.AddReferencedAssemblies(assembly);
            }

            return this.loadedAssemblies;
        }
        public AssemblyResolveHandler(AbsoluteFolderPath assemblyFolder)
        {
            this.assemblyFolder = assemblyFolder;

            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.AssemblyResolve += new ResolveEventHandler(this.HandleUnresolvedAssembly);
        }
Пример #3
0
        public void IsAssignableToString()
        {
            AbsoluteFolderPath absolutePath = new AbsoluteFolderPath(Path);

            string path = absolutePath;

            path.Should().Be(Path);
        }
        public void IsAssignableToString()
        {
            AbsoluteFolderPath absolutePath = new AbsoluteFolderPath(Path);

            string path = absolutePath;

            path.Should().Be(Path);
        }
Пример #5
0
        public void SupportsEquals(string aa, string bb, bool expected)
        {
            AbsoluteFolderPath a = aa;
            AbsoluteFolderPath b = bb;

            bool result = a == b;

            result.Should().Be(expected);
        }
Пример #6
0
        public void SupportsInequalityOperator(string aa, string bb, bool expected)
        {
            AbsoluteFolderPath a = aa;
            AbsoluteFolderPath b = bb;

            bool result = a != b;

            result.Should().Be(expected);
        }
Пример #7
0
        public void IsAssignableFromString()
        {
            AbsoluteFolderPath absoluteFolderPath = Path;

            absoluteFolderPath.Value.Should().Be(Path);
        }
Пример #8
0
        public void RepresentsAnAbsoluteFolderPath(string path)
        {
            var absoluteFolderPath = new AbsoluteFolderPath(path);

            absoluteFolderPath.Value.Should().Be(path);
        }
        public void RepresentsAnAbsoluteFolderPath(string path)
        {
            var absoluteFolderPath = new AbsoluteFolderPath(path);

            absoluteFolderPath.Value.Should().Be(path);
        }
 private CommandLineArguments(AbsoluteFilePath outputPath, AbsoluteFolderPath assemblyFolder, bool successful)
 {
     this.OutputPath = outputPath;
     this.AssemblyFolder = assemblyFolder;
     this.Successful = successful;
 }
 public static CommandLineArguments CreateSuccessful(
     AbsoluteFilePath outputPath,
     AbsoluteFolderPath assemblyFolder)
 {
     return new CommandLineArguments(outputPath, assemblyFolder, true);
 }