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); }
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); }
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; } } }