Example #1
0
        public void CanRemovePlugins_ThroughConfiguration()
        {
            int initialCount = finder.GetPlugins <NavigationPluginAttribute>().Count();

            finder = new PluginFinder(typeFinder, new SecurityManager(new ThreadContext(), new EditSection()), CreateEngineSection(new[] { new InterfacePluginElement {
                                                                                                                                               Name = "chill"
                                                                                                                                           } }));

            IEnumerable <NavigationPluginAttribute> plugins = finder.GetPlugins <NavigationPluginAttribute>();

            Assert.That(plugins.Count(), Is.EqualTo(initialCount - 1), "Found unexpected items, e.g.:" + plugins.FirstOrDefault());
        }
Example #2
0
 public ActionResult Index()
 {
     //加载插件
     PluginFinder _pluginFinder = new PluginFinder();
     List<IShippingMethod> shippingMethodList = _pluginFinder.GetPlugins<IShippingMethod>().ToList();
     ViewData["ShippingMethods"] = shippingMethodList;
     _indexService.GetTestName();
     var TestTable = _indexService.GetTestTable();
     var categoryModelList =
        TestTable.Select(p =>
        {
            var categoryModel = new CategoryModel();
            categoryModel.Id = p.Id;
            categoryModel.Name = p.Name;
            return categoryModel;
        });
     IEnumerable<CategoryModel> CategoryModel = categoryModelList;
     return View(categoryModelList);
 }
Example #3
0
        public void CanGetNavigationPlugIns()
        {
            IEnumerable <NavigationPluginAttribute> plugIns = finder.GetPlugins <NavigationPluginAttribute>();

            Assert.That(plugIns.Count(), Is.EqualTo(3));
        }
Example #4
0
        public void Can_get_plugins()
        {
            var plugins = _finder.GetPlugins <TestPluginAttribute>();

            plugins.Count().ShouldEqual(4);
        }
		public void CanRemovePlugins_ThroughConfiguration()
		{
			int initialCount = finder.GetPlugins<NavigationPluginAttribute>().Count();
			finder = new PluginFinder(typeFinder, new SecurityManager(new ThreadContext(), new EditSection()), CreateEngineSection(new[] { new InterfacePluginElement { Name = "chill" } }));
			
			IEnumerable<NavigationPluginAttribute> plugins = finder.GetPlugins<NavigationPluginAttribute>();
			
			Assert.That(plugins.Count(), Is.EqualTo(initialCount - 1), "Found unexpected items, e.g.:" + plugins.FirstOrDefault());
		}