コード例 #1
0
 public void ReplaceFromTest([PexAssumeUnderTest] XmpTag target, XmpTag tag, string ns, string name, string value)
 {
     PexAssume.IsNotNull(tag);
     PexAssume.IsNotNull(ns);
     PexAssume.IsNotNull(name);
     PexAssume.IsNotNull(value);
     tag.SetTextNode(ns, name, value);
     target.ReplaceFrom(tag);
     PexAssert.AreEqual(value, target.GetTextNode(ns, name));
     // TODO: add assertions to method XmpTagTest.ReplaceFromTest(XmpTag, XmpTag)
 }
コード例 #2
0
        /// <summary>
        /// Update the value of the specified node, or create it.
        /// Seems SetTextNode should work whether or not is already exists, but in some cases it doesn't.
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="ns"></param>
        /// <param name="name"></param>
        /// <param name="val"></param>
        void AddOrModify(XmpTag tag, string ns, string name, string val)
        {
            var node = tag.FindNode(ns, name);

            if (node != null)
            {
                node.Value = val;
            }
            else
            {
                tag.SetTextNode(ns, name, val);
            }
        }
コード例 #3
0
 public void SetTextNodeTest(
     [PexAssumeUnderTest] XmpTag target,
     string ns,
     string name,
     string value
     )
 {
     PexAssume.IsNotNull(ns);
     PexAssume.IsNotNull(name);
     target.SetTextNode(ns, name, value);
     PexAssert.AreEqual(target.GetTextNode(ns, name), value);
     // TODO: add assertions to method XmpTagTest.SetTextNodeTest(XmpTag, String, String, String)
 }
コード例 #4
0
        public uint?GetUIntNodeTest(
            [PexAssumeUnderTest] XmpTag target,
            string ns,
            string name,
            uint value
            )
        {
            PexAssume.IsNotNull(ns);
            PexAssume.IsNotNull(name);
            PexAssume.IsNotNull(value);
            target.SetTextNode(ns, name, value.ToString());
            uint?result = target.GetUIntNode(ns, name);

            PexAssert.AreEqual(result, value);
            return(result);
            // TODO: add assertions to method XmpTagTest.GetUIntNodeTest(XmpTag, String, String)
        }