Esempio n. 1
0
        public void Should_remember_Registred_assemblies()
        {
            var loader = new StaticAssemblyLoader();
            var self = AssemblyLoader.GetExecutingAssembly();
            loader.Register(self);

            loader.Load(self.Name).ShouldBeSameAs(self);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var config = XmlConfiguration.FromFile(args[0]).Read<ProjectConfiguration>();

            var loader = new StaticAssemblyLoader();
            var assemblies = new List<IAssembly>();
            var fs = new FileSystem();
            fs.GetFiles(new Pencil.IO.Path(config.BinPath), "*.*")
            .ForEach(IsAssembly, path =>
            {
                var assembly = AssemblyLoader.LoadFrom(path.ToString());
                loader.Register(assembly);
                assemblies.Add(assembly);
            });
            var digraph = new DirectedGraph();
            var dependencies = new AssemblyDependencyGraph(digraph, loader,
                IgnoreFilter.From(config.IgnoreAssemblies));
            assemblies.ForEach(dependencies.Add);

            new Pipe("invalid_path_to_dot", "-Tpng").Transfer(
                stream => new DotBuilder(stream).Write(digraph),
                stream => fs.WriteFile(new Path("output.png"), stream));
        }