public void XmlNameTest()
 {
     AtomTextConstruct target = new AtomTextConstruct(AtomTextConstructElementType.Rights);
     Assert.AreEqual(target.XmlName, AtomParserNameTable.XmlRightsElement);
     target = new AtomTextConstruct(AtomTextConstructElementType.Subtitle);
     Assert.AreEqual(target.XmlName, AtomParserNameTable.XmlSubtitleElement);
     target = new AtomTextConstruct(AtomTextConstructElementType.Title);
     Assert.AreEqual(target.XmlName, AtomParserNameTable.XmlTitleElement);
     target = new AtomTextConstruct(AtomTextConstructElementType.Summary);
     Assert.AreEqual(target.XmlName, AtomParserNameTable.XmlSummaryElement);
 }
       /////////////////////////////////////////////////////////////////////////////

       //////////////////////////////////////////////////////////////////////
       /// <summary>compares 2 text construct objects</summary> 
       /// <param name="theOne">the One</param>
       /// <param name="theOther">the Other</param>
       /// <returns>true if identical </returns>
       //////////////////////////////////////////////////////////////////////
       public static bool IsTextConstructIdentical(AtomTextConstruct theOne, AtomTextConstruct theOther)
       {
           if (theOne==null && theOther == null)
           {
               return true;
           }

           if (ObjectModelHelper.IsBaseIdentical(theOne, theOther)==false)
           {
               return false;
           }

           if (theOne.Type != theOther.Type)
           {
               return false;
           }
           if (String.Compare(theOne.Text,theOther.Text)!= 0)
           {
               return false;
           }
           if (String.Compare(theOne.XmlName, theOther.XmlName)!=0)
           {
               return false;
           }

           return true;
       }
Exemple #3
0
        /// <summary>takes the updated entry returned and sets the properties to this object</summary> 
        /// <param name="updatedEntry"> </param>
        protected void CopyEntry(AtomEntry updatedEntry) {
            Tracing.Assert(updatedEntry != null, "updatedEntry should not be null");
            if (updatedEntry == null) {
                throw new ArgumentNullException("updatedEntry");
            }

            this.title = updatedEntry.Title;
            this.authors = updatedEntry.Authors;
            this.id = updatedEntry.Id;
            this.links = updatedEntry.Links;
            this.lastUpdateDate = updatedEntry.Updated;
            this.publicationDate = updatedEntry.Published;
            this.authors = updatedEntry.Authors;
            this.rights = updatedEntry.Rights;
            this.categories = updatedEntry.Categories;
            this.summary = updatedEntry.Summary;
            this.content = updatedEntry.Content;
            this.source = updatedEntry.Source;

            this.ExtensionElements.Clear();

            foreach (IExtensionElementFactory extension in updatedEntry.ExtensionElements) {
                this.ExtensionElements.Add(extension);
            }
        }
Exemple #4
0
 internal virtual AtomBase CreateAtomBase()
 {
     AtomTextConstruct entry = new AtomTextConstruct();
     entry.Text = "test";
     return entry;
 }
        /// <summary>
        /// Get the Text of possibly null AtomTextConstruct
        /// </summary>
        /// <param name="textConstruct">The Google AtomTextConstruct</param>
        /// <returns>The value or empty string if the textConstruct or it's Text was null</returns>
        public static string SafeGetText(AtomTextConstruct textConstruct)
        {
            if (textConstruct == null)
            {
                return string.Empty;
            }

            return textConstruct.Text ?? string.Empty;
        }
 public void TypeTest()
 {
     AtomTextConstruct target = new AtomTextConstruct(); // TODO: Initialize to an appropriate value
     AtomTextConstructType expected = AtomTextConstructType.xhtml;
     AtomTextConstructType actual;
     target.Type = expected;
     actual = target.Type;
     Assert.AreEqual(expected, actual);
 }
 public void AtomTextConstructConstructorTest()
 {
     string text = "TestValue"; // TODO: Initialize to an appropriate value
     AtomTextConstruct target = new AtomTextConstruct(AtomTextConstructElementType.Summary, text);
     Assert.AreEqual(target.Text, text);
 }
 public void AtomTextConstructConstructorTest2()
 {
     AtomTextConstruct target = new AtomTextConstruct();
     Assert.IsNotNull(target);
     Assert.IsTrue(String.IsNullOrEmpty(target.Text)); 
 }
 public void TextTest()
 {
     AtomTextConstruct target = new AtomTextConstruct(); // TODO: Initialize to an appropriate value
     string expected = "TestValue";            
     string actual;
     target.Text = expected;
     actual = target.Text;
     Assert.AreEqual(expected, actual);
 }