예제 #1
0
 public void CreateFromRuntimeTest()
 {
     DatabaseSettings databaseSettings = DatabaseSettingsBuilder.Create(Host);
     DatabaseTypeData data = databaseSettings.DatabaseTypes["SqlServer"];
     DatabaseTypeNode node = new DatabaseTypeNode(data);
     CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
     Assert.AreEqual(data.Name, node.Name);
     Assert.AreEqual(data.TypeName, node.TypeName);
     ValidateNodeCommand cmd = new ValidateNodeCommand(Host);
     cmd.Execute(node);
     Assert.AreEqual(0, ValidationErrorsCount);
 }
예제 #2
0
        public void CreateFromRuntimeTest()
        {
            DatabaseSettings databaseSettings = DatabaseSettingsBuilder.Create(Host);
            DatabaseTypeData data             = databaseSettings.DatabaseTypes["SqlServer"];
            DatabaseTypeNode node             = new DatabaseTypeNode(data);

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            Assert.AreEqual(data.Name, node.Name);
            Assert.AreEqual(data.TypeName, node.TypeName);
            ValidateNodeCommand cmd = new ValidateNodeCommand(Host);

            cmd.Execute(node);
            Assert.AreEqual(0, ValidationErrorsCount);
        }
예제 #3
0
        public void NewDatabaseTypeNodeTest()
        {
            IUIHierarchy               hierarchy                  = HierarchyService.SelectedHierarchy;
            InstanceCollectionNode     collectionNode             = hierarchy.FindNodeByType(typeof(InstanceCollectionNode)) as InstanceCollectionNode;
            InstanceNode               localInstanceNode          = hierarchy.FindNodeByName(collectionNode, name) as InstanceNode;
            DatabaseTypeCollectionNode databaseTypeCollectionNode = hierarchy.FindNodeByType(typeof(DatabaseTypeCollectionNode)) as DatabaseTypeCollectionNode;
            DatabaseTypeNode           databaseTypeNode           = hierarchy.FindNodeByName(databaseTypeCollectionNode, "SqlServer") as DatabaseTypeNode;

            localInstanceNode.DatabaseTypeNode = databaseTypeNode;
            Assert.AreEqual(databaseTypeNode.Name, localInstanceNode.DatabaseTypeName);
            databaseTypeNode.Name = "newName";
            Assert.AreEqual(databaseTypeNode.Name, localInstanceNode.DatabaseTypeName);
            databaseTypeNode.Remove();
            Assert.IsNull(localInstanceNode.DatabaseTypeNode);
        }
예제 #4
0
 public override void SetUp()
 {
     base.SetUp();
     DatabaseSettings databaseSettings = DatabaseSettingsBuilder.Create(Host);
     DatabaseSettingsNode databaseSettingsNode = new DatabaseSettingsNode(databaseSettings);
     IUIHierarchy hierarchy = CreateHierarchyAndAddToHierarchyService(databaseSettingsNode, CreateDefaultConfiguration());
     ConfigurationNode[] nodes = hierarchy.FindNodesByType(typeof(DatabaseTypeNode));
     foreach (DatabaseTypeNode node in nodes)
     {
         if (node.Name == "SqlServer")
         {
             databaseTypeNode = node;
             break;
         }
     }
 }
예제 #5
0
        public override void SetUp()
        {
            base.SetUp();
            DatabaseSettings     databaseSettings     = DatabaseSettingsBuilder.Create(Host);
            DatabaseSettingsNode databaseSettingsNode = new DatabaseSettingsNode(databaseSettings);
            IUIHierarchy         hierarchy            = CreateHierarchyAndAddToHierarchyService(databaseSettingsNode, CreateDefaultConfiguration());

            ConfigurationNode[] nodes = hierarchy.FindNodesByType(typeof(DatabaseTypeNode));
            foreach (DatabaseTypeNode node in nodes)
            {
                if (node.Name == "SqlServer")
                {
                    databaseTypeNode = node;
                    break;
                }
            }
        }