예제 #1
0
 public static void SetUp()
 {
     byte[] value = new byte[] { unchecked ((int)(0x31)), unchecked ((int)(0x32)), unchecked (
                                     (int)(0x33)) };
     Xattr  = new XAttr.Builder().SetName("name").SetValue(value).Build();
     Xattr1 = new XAttr.Builder().SetNameSpace(XAttr.NameSpace.User).SetName("name").SetValue
                  (value).Build();
     Xattr2 = new XAttr.Builder().SetNameSpace(XAttr.NameSpace.Trusted).SetName("name"
                                                                                ).SetValue(value).Build();
     Xattr3 = new XAttr.Builder().SetNameSpace(XAttr.NameSpace.System).SetName("name")
              .SetValue(value).Build();
     Xattr4 = new XAttr.Builder().SetNameSpace(XAttr.NameSpace.Security).SetName("name"
                                                                                 ).SetValue(value).Build();
     Xattr5 = new XAttr.Builder().SetNameSpace(XAttr.NameSpace.Raw).SetName("name").SetValue
                  (value).Build();
 }
예제 #2
0
        /// <summary>
        /// Similar to
        /// <see cref="Equals(object)"/>
        /// , except ignores the XAttr value.
        /// </summary>
        /// <param name="obj">to compare equality</param>
        /// <returns>if the XAttrs are equal, ignoring the XAttr value</returns>
        public virtual bool EqualsIgnoreValue(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj == this)
            {
                return(true);
            }
            if (obj.GetType() != GetType())
            {
                return(false);
            }
            XAttr rhs = (XAttr)obj;

            return(new EqualsBuilder().Append(ns, rhs.ns).Append(name, rhs.name).IsEquals());
        }
예제 #3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj == this)
            {
                return(true);
            }
            if (obj.GetType() != GetType())
            {
                return(false);
            }
            XAttr rhs = (XAttr)obj;

            return(new EqualsBuilder().Append(ns, rhs.ns).Append(name, rhs.name).Append(value
                                                                                        , rhs.value).IsEquals());
        }