示例#1
0
 public void Create_XPath()
 {
     var user = GetFullUser();
     var userXml = GetUserXml(UserMixedXmlFormat, user);
     var source = XDocument.Parse(userXml);
     var map = new XPathToUserMap();
     var mappedUser = map.Create(source);
     AssertEqual(user, mappedUser);
 }
示例#2
0
        public void Create_XPath()
        {
            var user       = GetFullUser();
            var userXml    = GetUserXml(UserMixedXmlFormat, user);
            var source     = XDocument.Parse(userXml);
            var map        = new XPathToUserMap();
            var mappedUser = map.Create(source);

            AssertEqual(user, mappedUser);
        }
示例#3
0
 public void Specify_Invalid()
 {
     var map = new XPathToUserMap();
     AssertRaisesException<ArgumentException>(()=>map.Specify(XmlNodeType.CDATA, XName.Get("id", "ns"), x => x.Id), "XmlNodeType must be Element or Attribute; CDATA not supported{0}Parameter name: nodeType", Environment.NewLine);
 }
示例#4
0
        public void Specify_Invalid()
        {
            var map = new XPathToUserMap();

            AssertRaisesException <ArgumentException>(() => map.Specify(XmlNodeType.CDATA, XName.Get("id", "ns"), x => x.Id), "XmlNodeType must be Element or Attribute; CDATA not supported{0}Parameter name: nodeType", Environment.NewLine);
        }