Exemple #1
0
        public void EXComplexTest02()
        {
            EN name = new EN(EntityNameUse.License, new ENXP[] {});

            name.NullFlavor = null;
            Assert.IsFalse(name.Validate());
        }
Exemple #2
0
        public void ENXPQualifierTest()
        {
            string xml = "<name use=\"L\"><given>Neville</given><given qualifier=\"IN\">H.</given><family>Nuclear</family></name>";
            EN     x   = (EN)R1SerializationHelper.ParseString(xml, typeof(EN));

            Assert.IsTrue(x.Validate());
        }
Exemple #3
0
        public void ENPartTest()
        {
            EN en = new EN();

            en.Part.AddRange(GenerateNames());
            en.NullFlavor = null;
            Assert.IsTrue(en.Validate());
        }
Exemple #4
0
        public void ENPartNullFlavorTest()
        {
            EN en = new EN();

            en.NullFlavor = NullFlavor.Other;
            en.Part.AddRange(GenerateNames());
            Assert.IsFalse(en.Validate());
        }
Exemple #5
0
        public void ENNullPartNullFlavorTest()
        {
            EN en = new EN();

            en.NullFlavor = null;
            en.Part.Clear();
            Assert.IsFalse(en.Validate());
        }
Exemple #6
0
        public void ENNullFlavorTest()
        {
            EN en = new EN();

            en.NullFlavor = NullFlavor.NotAsked;
            en.Part.Clear();
            Assert.IsTrue(en.Validate());
        }
Exemple #7
0
        public void ENExampleTest04()
        {
            EN name = new EN
                      (
                EntityNameUse.Legal,
                new ENXP[] {}
                      );

            name.NullFlavor = NullFlavor.Other;
            Console.WriteLine(name.ToString("{FAM}, {GIV}"));
            // should output James Kirk Tieberius
            Assert.IsTrue(name.Validate());
        }
Exemple #8
0
        public void ENExampleTest01()
        {
            EN name = new EN
                      (
                EntityNameUse.Legal,
                new ENXP[] {
                // add name-parts to name
                new ENXP("James", EntityNamePartType.Given),
                new ENXP("Tiberius", EntityNamePartType.Given),
                new ENXP("Kirk", EntityNamePartType.Family),
            }
                      );

            name.NullFlavor = null;
            Console.WriteLine(name.ToString("{FAM}, {GIV}"));
            // should output James Kirk Tieberius
            Assert.IsTrue(name.Validate());
        }
Exemple #9
0
 public void ENNullPartNullFlavorTest()
 {
     EN en = new EN();
     en.NullFlavor = null;
     en.Part.Clear();
     Assert.IsFalse(en.Validate());
 }
Exemple #10
0
 public void ENNullFlavorTest()
 {
     EN en = new EN();
     en.NullFlavor = NullFlavor.NotAsked;
     en.Part.Clear();
     Assert.IsTrue(en.Validate());
 }
Exemple #11
0
        public void EXComplexTest01()
        {
            EN name = new EN(EntityNameUse.License,
                new ENXP[] {

                    // add a Title name-part to the name
                    new ENXP("Dr.", EntityNamePartType.Title)
                    {
                        // assign qualifiers to the 'Title' name-part
                        Qualifier = new SET<CS<EntityNamePartQualifier>>()
                        {
                            EntityNamePartQualifier.Academic,
                            EntityNamePartQualifier.Prefix
                        }
                    },
                    
                    // add the first name as 'Given' name-part
                    new ENXP("John", EntityNamePartType.Given),

                    // add an initial as 'Given' name-part
                    new ENXP("G", EntityNamePartType.Given)
                    {
                        // assign the Initial qualifier to the name-part
                        Qualifier = new SET<CS<EntityNamePartQualifier>>()
                        {
                            EntityNamePartQualifier.Initial
                        }
                    },

                    // add a middle name as 'Given' name-part
                    new ENXP("Jacob", EntityNamePartType.Given)
                    {
                        // assign the 'Middle' qualifier to the middle name
                        Qualifier = new SET<CS<EntityNamePartQualifier>>()
                        {
                            EntityNamePartQualifier.Middle
                        }
                    },

                    // add part of the last name as 'Family' name-part
                    new ENXP("Jingleheimer", EntityNamePartType.Family),

                    // hyphens in a name must be a 'Delimiter' name-part
                    new ENXP("-", EntityNamePartType.Delimiter),

                    // add part of the last name as 'Family' name-part
                    new ENXP("Schmidt", EntityNamePartType.Family),

                    // add inherited suffix name-part with qualifiers 'Birth' and 'Suffix'
                    new ENXP("II")
                    {
                        Qualifier = new SET<CS<EntityNamePartQualifier>>()
                        {
                            EntityNamePartQualifier.Birth,
                            EntityNamePartQualifier.Suffix
                        }
                    } //end final ENXP
                } // end ENXP[] array
            ); // close parameters for EN

            Assert.IsTrue(name.Validate());

        } // end EXComplexTest01
Exemple #12
0
 public void ENExampleTest04()
 {
     EN name = new EN
         (
             EntityNameUse.Legal,
             new ENXP[] {}
         );
     name.NullFlavor = NullFlavor.Other;
     Console.WriteLine(name.ToString("{FAM}, {GIV}"));
     // should output James Kirk Tieberius
     Assert.IsTrue(name.Validate());
 }
Exemple #13
0
        public void EXComplexTest01()
        {
            EN name = new EN(EntityNameUse.License,
                             new ENXP[] {
                // add a Title name-part to the name
                new ENXP("Dr.", EntityNamePartType.Title)
                {
                    // assign qualifiers to the 'Title' name-part
                    Qualifier = new SET <CS <EntityNamePartQualifier> >()
                    {
                        EntityNamePartQualifier.Academic,
                        EntityNamePartQualifier.Prefix
                    }
                },

                // add the first name as 'Given' name-part
                new ENXP("John", EntityNamePartType.Given),

                // add an initial as 'Given' name-part
                new ENXP("G", EntityNamePartType.Given)
                {
                    // assign the Initial qualifier to the name-part
                    Qualifier = new SET <CS <EntityNamePartQualifier> >()
                    {
                        EntityNamePartQualifier.Initial
                    }
                },

                // add a middle name as 'Given' name-part
                new ENXP("Jacob", EntityNamePartType.Given)
                {
                    // assign the 'Middle' qualifier to the middle name
                    Qualifier = new SET <CS <EntityNamePartQualifier> >()
                    {
                        EntityNamePartQualifier.Middle
                    }
                },

                // add part of the last name as 'Family' name-part
                new ENXP("Jingleheimer", EntityNamePartType.Family),

                // hyphens in a name must be a 'Delimiter' name-part
                new ENXP("-", EntityNamePartType.Delimiter),

                // add part of the last name as 'Family' name-part
                new ENXP("Schmidt", EntityNamePartType.Family),

                // add inherited suffix name-part with qualifiers 'Birth' and 'Suffix'
                new ENXP("II")
                {
                    Qualifier = new SET <CS <EntityNamePartQualifier> >()
                    {
                        EntityNamePartQualifier.Birth,
                        EntityNamePartQualifier.Suffix
                    }
                }               //end final ENXP
            }                   // end ENXP[] array
                             ); // close parameters for EN

            Assert.IsTrue(name.Validate());
        } // end EXComplexTest01
Exemple #14
0
 public void ENPartNullFlavorTest()
 {
     EN en = new EN();
     en.NullFlavor = NullFlavor.Other;
     en.Part.AddRange(GenerateNames());
     Assert.IsFalse(en.Validate());
 }
Exemple #15
0
        public void ENExampleTest01()
        {
            EN name = new EN
                (
                    EntityNameUse.Legal,
                    new ENXP[] {

                        // add name-parts to name
                        new ENXP("James", EntityNamePartType.Given),
                        new ENXP("Tiberius", EntityNamePartType.Given),
                        new ENXP("Kirk", EntityNamePartType.Family),
                    }
                );
            name.NullFlavor = null;
            Console.WriteLine(name.ToString("{FAM}, {GIV}"));
            // should output James Kirk Tieberius
            Assert.IsTrue(name.Validate());
        }
Exemple #16
0
 public void ENPartTest()
 {
     EN en = new EN();
     en.Part.AddRange(GenerateNames());
     en.NullFlavor = null;
     Assert.IsTrue(en.Validate());
 }
Exemple #17
0
 public void EXComplexTest02()
 {
     EN name = new EN(EntityNameUse.License, new ENXP[]{});
     name.NullFlavor = null;
     Assert.IsFalse(name.Validate());
 }