Example #1
0
        public void ThreeLevelHierarchyTest3()
        {
            try
            {
                var root = new HierarchyRoot {
                    Name = "Bob, Sr."
                };
                DataModel <HierarchyRoot> .Save(root);

                var child = new HierarchyChild {
                    Name = "Bob, Jr.", Root = root
                };
                DataModel <HierarchyChild> .Save(child);

                var grandChild = new HierarchyGrandChild {
                    Name = "Bob, 3rd", Parent = child
                };
                DataModel <HierarchyGrandChild> .Save(grandChild);

                root = DataModel <HierarchyRoot> .NewQuery().SelectFirst(1, ProviderDefaults.AppProvider, null).Entity;

                Assert.IsNotNull(root);
                Assert.IsTrue(root.Name == "Bob, Sr.");
                Assert.IsNotNull(root.Children);
                Assert.IsTrue(root.Children.Count > 0);
                Assert.IsTrue(root.Children[0].Name == "Bob, Jr.");
                Assert.IsNull(root.Children[0].Children);
            }
            finally
            {
                // clean-up
                ReloadData_HierarchyTables();
            }
        }
Example #2
0
 /**
  * This method exists to remove a particular set of elements from the two Lists of this script.
  * */
 public void RemoveObjectFromChildren( GameObject child, HierarchyChild script )
 {
     if ( hierChildren.Contains( child ) )
         hierChildren.Remove(child);
     else if ( hierChildrenScripts.Contains( script ) )
         hierChildrenScripts.Remove( script );
 }
Example #3
0
        public void ThreeLevelHierarchyTest1()
        {
            try
            {
                var root = new HierarchyRoot {
                    Name = "Bob, Sr."
                };
                DataModel <HierarchyRoot> .Save(root);

                var child = new HierarchyChild {
                    Name = "Bob, Jr.", Root = root
                };
                DataModel <HierarchyChild> .Save(child);

                var grandChild = new HierarchyGrandChild {
                    Name = "Bob, 3rd", Parent = child
                };
                DataModel <HierarchyGrandChild> .Save(grandChild);

                Assert.IsTrue(grandChild.Name == "Bob, 3rd");
                Assert.IsNotNull(grandChild.Parent);
                Assert.IsTrue(grandChild.Parent.Name == "Bob, Jr.");
                Assert.IsNotNull(grandChild.Parent.Root);
                Assert.IsTrue(grandChild.Parent.Root.Name == "Bob, Sr.");
            }
            finally
            {
                // clean-up
                ReloadData_HierarchyTables();
            }
        }
Example #4
0
 // End Helper methods for ClickOnParent()
 /**
  * This method exists as a helper to populate the list of 'Children' associated with this HierarchyParnet
  * They are stored as GameObjects and not as any type of UI object because I want to be able to call the
  * 	SetActive method on them. The actual children themselves will handle all the necessary non GameObject
  * 	related funtions.
  * */
 public void AddObjectToChildren( GameObject child, HierarchyChild script )
 {
     hierChildren.Add( child );
     hierChildrenScripts.Add( script );
 }