public void Clone() { XmlSyndicationContent t = new XmlSyndicationContent("text/plain", 3, (XmlObjectSerializer)null); t = t.Clone() as XmlSyndicationContent; Assert.AreEqual("text/plain", t.Type, "#1"); }
public void Clone_Empty_ReturnsExpected() { var content = new SyndicationElementExtension(new ExtensionObject { Value = 10 }); var original = new XmlSyndicationContent("type", content); XmlSyndicationContent clone = Assert.IsType <XmlSyndicationContent>(original.Clone()); Assert.Empty(clone.AttributeExtensions); Assert.Same(original.Extension, clone.Extension); Assert.Equal("type", clone.Type); }
public void Clone_Full_ReturnsExpected() { var content = new SyndicationElementExtension(new ExtensionObject { Value = 10 }); var original = new XmlSyndicationContent("type", content); original.AttributeExtensions.Add(new XmlQualifiedName("name"), "value"); XmlSyndicationContent clone = Assert.IsType <XmlSyndicationContent>(original.Clone()); Assert.NotSame(clone.AttributeExtensions, original.AttributeExtensions); Assert.Equal(1, clone.AttributeExtensions.Count); Assert.Equal("value", clone.AttributeExtensions[new XmlQualifiedName("name")]); Assert.Same(original.Extension, clone.Extension); Assert.Equal("type", clone.Type); }
public void Clone () { XmlSyndicationContent t = new XmlSyndicationContent ("text/plain", 3, (XmlObjectSerializer) null); t = t.Clone () as XmlSyndicationContent; Assert.AreEqual ("text/plain", t.Type, "#1"); }