Esempio n. 1
0
        public void ImportFrom(PluginGraph graph)
        {
            foreach (PluginFamily family in graph.PluginFamilies)
            {
                if (family.IsGenericTemplate)
                {
                    _genericsGraph.ImportFrom(family);
                }
                else
                {
                    ForType(family.PluginType).ImportFrom(family);
                }
            }

            _profileManager.ImportFrom(graph.ProfileManager);
        }
Esempio n. 2
0
        public void Import_from_adds_all_new_PluginFamily_from_source()
        {
            var sourceFamily  = new PluginFamily(typeof(ISomething <>));
            var sourceFamily2 = new PluginFamily(typeof(ISomething2 <>));
            var sourceFamily3 = new PluginFamily(typeof(ISomething3 <>));
            var source        = new GenericsPluginGraph();

            source.AddFamily(sourceFamily);
            source.AddFamily(sourceFamily2);
            source.AddFamily(sourceFamily3);

            var destination = new GenericsPluginGraph();

            destination.ImportFrom(source);

            Assert.AreEqual(3, destination.FamilyCount);

            Assert.AreNotSame(sourceFamily, destination.FindFamily(typeof(ISomething <>)));
        }