public void TestInitialize()
 {
     appNode         = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain());
     serviceProvider = ServiceBuilder.Build();
     hierarchy       = new ConfigurationUIHierarchy(appNode, serviceProvider);
     appNode.AddNode(new MyTestNode());
     removeEventCount = 0;
 }
        public void TestThatAValidationThatFailsReportsErrorsToUI()
        {
            TestNode            node     = new TestNode();
            IServiceProvider    provider = ServiceBuilder.Build();
            ValidateNodeCommand cmd      = new ValidateNodeCommand(provider, true, false);

            cmd.Execute(node);
            MockUIService uiService = provider.GetService(typeof(IUIService)) as MockUIService;

            Assert.AreEqual(1, uiService.ValidationErrorsCount);
        }
Beispiel #3
0
        public void TestInitialize()
        {
            ConfigurationApplicationNode node = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain());

            serviceProvider = ServiceBuilder.Build();
            hierarchy       = new ConfigurationUIHierarchy(node, serviceProvider);
            ServiceContainer container = (ServiceContainer)serviceProvider;

            container.RemoveService(typeof(IUIService));
            container.AddService(typeof(IUIService), new TestUIService(serviceProvider, this));
        }
 public void TestInitialize()
 {
     node            = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain());
     serviceProvider = ServiceBuilder.Build();
     hierarchy       = new ConfigurationUIHierarchy(node, serviceProvider);
     nodeA           = new MyTestNode();
     nodeB           = new MyTestNode();
     nodeC           = new MyTestNode();
     node.AddNode(nodeA);
     node.AddNode(nodeB);
     node.AddNode(nodeC);
 }
        public void TestInitialize()
        {
            BeforeSetup();

            appNode         = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain());
            serviceProvider = ServiceBuilder.Build();
            hierarchy       = new ConfigurationUIHierarchy(appNode, serviceProvider);
            ServiceHelper.GetUIHierarchyService(ServiceProvider).SelectedHierarchy = Hierarchy;
            hierarchy.Load();
            InitializeCore();

            AfterSetup();
        }
Beispiel #6
0
 public void TestInitialize()
 {
     workingNode             = null;
     node                    = new ConfigurationApplicationNode();
     hierarchy               = new ConfigurationUIHierarchy(node, ServiceBuilder.Build());
     addingChildEventCount   = 0;
     addChildEventCount      = 0;
     removingChildEventCount = 0;
     removeChildEventCount   = 0;
     renamingEventCount      = 0;
     renamedEventCount       = 0;
     removingEventCount      = 0;
     removeEventCount        = 0;
 }
Beispiel #7
0
 public void TestInitialize()
 {
     serviceProvider = ServiceBuilder.Build();
 }
        public void EnsureRemoveHierarchyAndRemoveEventFired()
        {
            using (IConfigurationUIHierarchyService hierarchyService = new ConfigurationUIHierarchyService())
            {
                hierarchyService.HierarchyRemoved += new EventHandler <HierarchyRemovedEventArgs>(OnHierarchyRemoved);
                ConfigurationApplicationNode appNode   = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain());
                IConfigurationUIHierarchy    hierarchy = new ConfigurationUIHierarchy(appNode, ServiceBuilder.Build());
                hierarchyService.AddHierarchy(hierarchy);
                hierarchyService.RemoveHierarchy(appNode.Id);
                IConfigurationUIHierarchy foundHierarchy = hierarchyService.GetHierarchy(appNode.Id);
                hierarchyService.HierarchyRemoved -= new EventHandler <HierarchyRemovedEventArgs>(OnHierarchyRemoved);

                Assert.AreEqual(1, removedEventCount);
                Assert.AreSame(hierarchy, eventHierarchy);
                Assert.IsNull(foundHierarchy);
            }
        }
 public void CanFindHierarchyById()
 {
     using (IConfigurationUIHierarchyService hierarchyService = new ConfigurationUIHierarchyService())
     {
         ConfigurationApplicationNode appNode   = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain());
         IConfigurationUIHierarchy    hierarchy = new ConfigurationUIHierarchy(appNode, ServiceBuilder.Build());
         hierarchyService.AddHierarchy(hierarchy);
         IConfigurationUIHierarchy foundHierarchy = hierarchyService.GetHierarchy(appNode.Id);
         Assert.AreSame(hierarchy, foundHierarchy);
     }
 }
        private static IConfigurationUIHierarchy CreateHierarchy()
        {
            ConfigurationApplicationNode appNode = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain());

            return(new ConfigurationUIHierarchy(appNode, ServiceBuilder.Build()));
        }
        public void FindTypeNodeInHierarchy()
        {
            ConfigurationApplicationFile applicationData = ConfigurationApplicationFile.FromCurrentAppDomain();
            ConfigurationApplicationNode applicationNode = new ConfigurationApplicationNode(applicationData);
            IConfigurationUIHierarchy    hierarchy       = new ConfigurationUIHierarchy(applicationNode, ServiceBuilder.Build());
            MyConfigNode configNode = new MyConfigNode("MyBlock");

            applicationNode.AddNode(configNode);
            ConfigurationNode node = (ConfigurationNode)hierarchy.FindNodeByType(typeof(MyConfigNode));

            Assert.IsNotNull(node);
            Assert.AreSame(configNode, node);
        }
        public void MakeSureThatCurrentAppDomainConfigurationFileIsSetForApplication()
        {
            ConfigurationApplicationFile applicationData = ConfigurationApplicationFile.FromCurrentAppDomain();
            ConfigurationApplicationNode node            = new ConfigurationApplicationNode(applicationData);
            ConfigurationUIHierarchy     hierarchy       = new ConfigurationUIHierarchy(node, ServiceBuilder.Build());

            Assert.AreEqual(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, node.ConfigurationFile);
        }
 public void TestInitialize()
 {
     rootNode = new ConfigurationApplicationNode();
     hierachy = new ConfigurationUIHierarchy(rootNode, ServiceBuilder.Build());
 }