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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
0
        public void IsAssignableFromString()
        {
            AbsoluteFolderPath absoluteFolderPath = Path;

            absoluteFolderPath.Value.Should().Be(Path);
        }
Ejemplo n.º 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);
 }