Пример #1
0
        private XmpNode NewNode(string ns, string name, XmpNodeType type)
        {
            XmpNode node = NewNode(ns, name);

            node.Type = type;
            return(node);
        }
Пример #2
0
 public void SetCollectionNodeTest(
     [PexAssumeUnderTest] XmpTag target,
     string ns,
     string name,
     string[] values,
     XmpNodeType type
     )
 {
     PexAssume.IsNotNull(ns);
     PexAssume.IsNotNull(name);
     PexAssume.IsNotNull(values);
     PexAssume.IsTrue(!values.Contains(null));
     PexAssume.IsTrue(type != XmpNodeType.Simple && type != XmpNodeType.Alt);
     target.SetCollectionNode(ns, name, values, type);
     PexAssert.IsTrue(values.SequenceEqual(target.GetCollectionNode(ns, name)));
     // TODO: add assertions to method XmpTagTest.SetCollectionNodeTest(XmpTag, String, String, String[], XmpNodeType)
 }
Пример #3
0
        public void SetCollectionNode(string ns, string name, string[] values, XmpNodeType type)
        {
            if (type == XmpNodeType.Simple || type == XmpNodeType.Alt)
            {
                throw new ArgumentException("type");
            }
            if (values == null)
            {
                RemoveNode(ns, name);
                return;
            }
            var node = NewNode(ns, name, type);

            foreach (string value in values)
            {
                node.AddChild(new XmpNode(RDF_NS, LI_URI, value));
            }
        }
Пример #4
0
		/// <summary>
		///    Sets a <see cref="System.String[]"/> as texts to the children of the
		///    node associated with the namespace <paramref name="ns"/> and the name
		///    <paramref name="name"/>.
		/// </summary>
		/// <param name="ns">
		///    A <see cref="System.String"/> with the namespace of the node.
		/// </param>
		/// <param name="name">
		///    A <see cref="System.String"/> with the name of the node.
		/// </param>
		/// <param name="values">
		///    A <see cref="System.String[]"/> with the values to set for the children.
		/// </param>
		/// <param name="type">
		///    A <see cref="XmpNodeType"/> with the type of the parent node.
		/// </param>
		public void SetCollectionNode (string ns, string name, string [] values, XmpNodeType type)
		{
			if (type == XmpNodeType.Simple || type == XmpNodeType.Alt)
				throw new ArgumentException ("type");

			if (values == null) {
				RemoveNode (ns, name);
				return;
			}

			var node = NewNode (ns, name, type);
			foreach (string value in values)
				node.AddChild (new XmpNode (RDF_NS, LI_URI, value));
		}
Пример #5
0
		private XmpNode NewNode (string ns, string name, XmpNodeType type)
		{
			XmpNode node = NewNode (ns, name);
			node.Type = type;

			return node;
		}