コード例 #1
0
        public void ValidateParentNodeCTypeBothDependantToUnit()
        {
            OOBNode n00 = new OOBNode("test0", "test0", ods, "UNITS");
            OOBNode n01 = new OOBNode("test1", "test1", ods, "UNITS");
            OOBNode n02 = new OOBNode("test2", "test2", ods, "UNITS");
            OOBNode n10 = new OOBNode("test3", "test3", ods, "UNITS");
            OOBNode n11 = new OOBNode("test4", "test4", ods, "EQUIPMENT");

            n00.addChild(n01);
            n01.addChild(n02);
            n10.addChild(n11);
            n01.addChild(n10);

            Assert.IsTrue(n00.CType.Equals("BOTH"));
        }
コード例 #2
0
        public void ValidateNodeCTypeUnits()
        {
            OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
            OOBNode n1 = new OOBNode("test1", "test1", ods, "UNITS");

            n0.addChild(n1);
            Assert.IsTrue(n0.CType.Equals("UNITS"));
        }
コード例 #3
0
        public void IsRootTestFalse()
        {
            OOBNode n0 = new OOBNode("test0", "test0", ods, "test0");
            OOBNode n1 = new OOBNode("test1", "test1", ods, "test1");

            n0.addChild(n1);
            Assert.IsFalse(n1.IsRoot);
        }
コード例 #4
0
        public void ValidateNodeCTypeDependants()
        {
            OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
            OOBNode n1 = new OOBNode("test1", "test1", ods, "EQUIPMENT");

            n0.addChild(n1);
            Assert.IsTrue(n0.CType.Equals("DEPENDANTS"));
        }
コード例 #5
0
        public void ValidateParentName()
        {
            OOBNode n0 = new OOBNode("test0", "test0", ods, "test0");
            OOBNode n1 = new OOBNode("test1", "test1", ods, "test1");

            n0.addChild(n1);
            Assert.AreEqual(n1.ParentName, n0.Name);
        }
コード例 #6
0
        public void AddChildIncreaseNumChildren()
        {
            OOBNode n00         = new OOBNode("test0", "test0", ods, "UNITS");
            OOBNode n01         = new OOBNode("test1", "test1", ods, "UNITS");
            int     numChildren = n00.Children.Count;

            n00.addChild(n01);

            Assert.IsTrue(numChildren < n00.Children.Count);
        }
コード例 #7
0
        public void ValidateNodeCTypeBoth()
        {
            OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
            OOBNode n1 = new OOBNode("test1", "test1", ods, "UNITS");
            OOBNode n2 = new OOBNode("test2", "test2", ods, "EQUIPMENT");

            n0.addChild(n1);
            n1.addChild(n2);
            Assert.IsTrue(n0.CType.Equals("BOTH"));
        }
コード例 #8
0
        public void ValidateAllParentNodeCTypeBoth()
        {
            OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
            OOBNode n1 = new OOBNode("test1", "test1", ods, "UNITS");
            OOBNode n2 = new OOBNode("test1", "test1", ods, "UNITS");
            OOBNode n3 = new OOBNode("test3", "test3", ods, "EQUIPMENT");

            n0.addChild(n1);
            n1.addChild(n2);
            n2.addChild(n3);
            Assert.IsTrue(n3.Parent.Parent.CType.Equals("BOTH") && n3.Parent.Parent.Parent.CType.Equals("BOTH"));
        }
コード例 #9
0
        public void GetDescendantDoesNotExist()
        {
            OOBNode n00 = new OOBNode("test0", "test0", ods, "UNITS");
            OOBNode n01 = new OOBNode("test1", "test1", ods, "UNITS");
            OOBNode n02 = new OOBNode("test2", "test2", ods, "UNITS");

            n00.addChild(n01);
            n01.addChild(n02);
            OOBNode n = n00.GetDescendant("test3");

            n00.removeChild("test1");

            Assert.AreNotEqual(n02, n);
        }
コード例 #10
0
        public void ValidateParentNodeCTypeBothUnitToDependant()
        {
            OOBNode n00 = new OOBNode("test0", "test0", ods, "UNITS");
              OOBNode n01 = new OOBNode("test1", "test1", ods, "UNITS");
              OOBNode n02 = new OOBNode("test2", "test2", ods, "UNITS");

              OOBNode n10 = new OOBNode("test3", "test3", ods, "UNITS");
              OOBNode n11 = new OOBNode("test4", "test4", ods, "EQUIPMENT");

              n00.addChild(n01);
              n01.addChild(n02);
              n10.addChild(n11);
              n10.addChild(n00);

              Assert.IsTrue(n10.CType.Equals("BOTH"));
        }
コード例 #11
0
 public void ValidateParentName()
 {
     OOBNode n0 = new OOBNode("test0", "test0", ods, "test0");
       OOBNode n1 = new OOBNode("test1", "test1", ods, "test1");
       n0.addChild(n1);
       Assert.AreEqual(n1.ParentName, n0.Name);
 }
コード例 #12
0
 public void ValidateNodeCTypeUnits()
 {
     OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
       OOBNode n1 = new OOBNode("test1", "test1", ods, "UNITS");
       n0.addChild(n1);
       Assert.IsTrue(n0.CType.Equals("UNITS"));
 }
コード例 #13
0
 public void ValidateNodeCTypeDependants()
 {
     OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
       OOBNode n1 = new OOBNode("test1", "test1", ods, "EQUIPMENT");
       n0.addChild(n1);
       Assert.IsTrue(n0.CType.Equals("DEPENDANTS"));
 }
コード例 #14
0
 public void ValidateNodeCTypeBoth()
 {
     OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
       OOBNode n1 = new OOBNode("test1", "test1", ods, "UNITS");
       OOBNode n2 = new OOBNode("test2", "test2", ods, "EQUIPMENT");
       n0.addChild(n1);
       n1.addChild(n2);
       Assert.IsTrue(n0.CType.Equals("BOTH"));
 }
コード例 #15
0
 public void ValidateAllParentNodeCTypeBoth()
 {
     OOBNode n0 = new OOBNode("test0", "test0", ods, "UNITS");
       OOBNode n1 = new OOBNode("test1", "test1", ods, "UNITS");
       OOBNode n2 = new OOBNode("test1", "test1", ods, "UNITS");
       OOBNode n3 = new OOBNode("test3", "test3", ods, "EQUIPMENT");
       n0.addChild(n1);
       n1.addChild(n2);
       n2.addChild(n3);
       Assert.IsTrue(n3.Parent.Parent.CType.Equals("BOTH") && n3.Parent.Parent.Parent.CType.Equals("BOTH"));
 }
コード例 #16
0
        public void AddChildIncreaseNumChildren()
        {
            OOBNode n00 = new OOBNode("test0", "test0", ods, "UNITS");
              OOBNode n01 = new OOBNode("test1", "test1", ods, "UNITS");
              int numChildren = n00.Children.Count;
              n00.addChild(n01);

              Assert.IsTrue(numChildren < n00.Children.Count);
        }
コード例 #17
0
        public void GetDescendantDoesNotExist()
        {
            OOBNode n00 = new OOBNode("test0", "test0", ods, "UNITS");
              OOBNode n01 = new OOBNode("test1", "test1", ods, "UNITS");
              OOBNode n02 = new OOBNode("test2", "test2", ods, "UNITS");

              n00.addChild(n01);
              n01.addChild(n02);
              OOBNode n = n00.GetDescendant("test3");
              n00.removeChild("test1");

              Assert.AreNotEqual(n02, n);
        }
コード例 #18
0
 public void IsRootTestFalse()
 {
     OOBNode n0 = new OOBNode("test0", "test0", ods, "test0");
       OOBNode n1 = new OOBNode("test1", "test1", ods, "test1");
       n0.addChild(n1);
       Assert.IsFalse(n1.IsRoot);
 }