예제 #1
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "TelephoneNumbers") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 TelephoneNumbers.Add(cn.InnerText);
             }
         }
         else if (string.Compare(name, "FacsimileNumbers") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 FacsimileNumbers.Add(cn.InnerText);
             }
         }
         else if (string.Compare(name, "ElectronicMailAddresses") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 ElectronicMailAddresses.Add(cn.InnerText);
             }
         }
         else if (string.Compare(name, "MessagingIDs") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 MessagingIDs.Add(cn.InnerText);
             }
         }
         else if (string.Compare(name, "PagerNumber", true) == 0)
         {
             PagerNumber = child.InnerText;
         }
         else if (string.Compare(name, "WWWHomePageURL", true) == 0)
         {
             WWWHomePageURL = child.InnerText;
         }
     }
     if (xml.HasAttribute("PagerNumber"))
     {
         PagerNumber = xml.Attributes["PagerNumber"].Value;
     }
     if (xml.HasAttribute("WWWHomePageURL"))
     {
         WWWHomePageURL = xml.Attributes["WWWHomePageURL"].Value;
     }
 }
예제 #2
0
        public void Add_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            var telephoneNumbers  = new TelephoneNumbers();
            ITelephoneNumber item = null;

            // Act
            telephoneNumbers.Add(
                // ReSharper disable once ExpressionIsAlwaysNull
                item);

            // Assert
            Assert.That(telephoneNumbers.Count, Is.EqualTo(0));
        }