public void Clone_NoExtensions_ReturnsExpected() { var category = new SyndicationCategory(); SyndicationElementExtensionCollection elementExtensions = category.ElementExtensions; SyndicationElementExtensionCollection clone = category.Clone().ElementExtensions; Assert.Empty(clone); }
public void Clone_Empty_ReturnsExpected() { var original = new SyndicationCategory(); SyndicationCategory clone = original.Clone(); Assert.Empty(clone.AttributeExtensions); Assert.Empty(clone.ElementExtensions); Assert.Null(clone.Label); Assert.Null(clone.Name); Assert.Null(clone.Scheme); }
public void Clone_WithExtensions_ReturnsExpected() { var category = new SyndicationCategory(); SyndicationElementExtensionCollection elementExtensions = category.ElementExtensions; elementExtensions.Add(new ExtensionObject { Value = 10 }); SyndicationElementExtensionCollection clone = category.Clone().ElementExtensions; Assert.Equal(1, clone.Count); elementExtensions.Clear(); Assert.Equal(1, clone.Count); }
public void Ctor_SyndicationCategory_Full() { var original = new SyndicationCategory("name", "scheme", "label"); original.AttributeExtensions.Add(new XmlQualifiedName("name"), "value"); original.ElementExtensions.Add(new ExtensionObject { Value = 10 }); SyndicationCategory clone = original.Clone(); Assert.NotSame(clone.AttributeExtensions, original.AttributeExtensions); Assert.Equal(1, clone.AttributeExtensions.Count); Assert.Equal("value", clone.AttributeExtensions[new XmlQualifiedName("name")]); Assert.NotSame(clone.ElementExtensions, original.ElementExtensions); Assert.Equal(1, clone.ElementExtensions.Count); Assert.Equal(10, clone.ElementExtensions[0].GetObject <ExtensionObject>().Value); Assert.Equal("label", clone.Label); Assert.Equal("name", clone.Name); Assert.Equal("scheme", clone.Scheme); }