Ejemplo n.º 1
0
 public static string GetNodeAttr(BinaryNode node, string attrName)
 {
     for (int i = 0; i < node.GetAttrNum(); i++)
     {
         BinaryAttr attr = node.GetAttr(i);
         if (attr.GetName() == attrName)
         {
             return(attr.GetValueString());
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
        public void BinaryAttribute_Add_RetrieveFail()
        {
            // Arrange
            BinaryAttrSet set  = new BinaryAttrSet();
            BinaryAttr    attr = new BinaryAttr("Test1", true, set);

            // Act
            set.AddAttribute(attr);
            BinaryAttr attrRetrieved = set.GetAttr("Test2");

            // Assert
            Assert.IsNull(attrRetrieved);
        }
Ejemplo n.º 3
0
        public void BinaryAttribute_Add_RetrieveSuccess()
        {
            // Arrange
            BinaryAttrSet set  = new BinaryAttrSet();
            BinaryAttr    attr = new BinaryAttr("Test1", true, set);

            // Act
            set.AddAttribute(attr);
            BinaryAttr attrRetrieved = set.GetAttr("Test1");

            // Assert
            Assert.AreEqual(true, attrRetrieved.Value);
        }