コード例 #1
0
ファイル: EV-1089.cs プロジェクト: zzllkk2003/everest
        public void EV_1089ENXPParseTest()
        {
            EN myEn = EN.FromFamilyGiven(EntityNameUse.License, "Toet", "J");

            myEn.Part[0].Qualifier = new SET <CS <EntityNamePartQualifier> >();
            myEn.Part[1].Qualifier = new SET <CS <EntityNamePartQualifier> >();
            myEn.Part[0].Qualifier.Add(EntityNamePartQualifier.Birth);
            myEn.Part[1].Qualifier.Add(EntityNamePartQualifier.Initial);
            String xmlString = R1SerializationHelper.SerializeAsString(myEn);

            StringReader      sr   = new StringReader(xmlString);
            DatatypeFormatter fmtr = new DatatypeFormatter();
            XmlStateReader    rdr  = new XmlStateReader(XmlReader.Create(sr));

            while (rdr.NodeType != XmlNodeType.Element)
            {
                rdr.Read();
            }
            var result = fmtr.Parse(rdr, typeof(EN));

            Assert.AreEqual(0, result.Details.Count(o => o.Type == Connectors.ResultDetailType.Error));
        }