public void Clone_Empty_ReturnsExpected() { var original = new UrlSyndicationContent(new Uri("http://microsoft.com"), "mediaType"); UrlSyndicationContent clone = Assert.IsType <UrlSyndicationContent>(original.Clone()); Assert.Empty(clone.AttributeExtensions); Assert.Equal("mediaType", clone.Type); Assert.Equal(new Uri("http://microsoft.com"), clone.Url); }
public void Clone() { Uri uri = new Uri("http://mono-project.com"); UrlSyndicationContent t = new UrlSyndicationContent(uri, "text/plain"); t = t.Clone() as UrlSyndicationContent; Assert.AreEqual(uri, t.Url, "#1"); Assert.AreEqual("text/plain", t.Type, "#2"); }
public void Clone_Full_ReturnsExpected() { var original = new UrlSyndicationContent(new Uri("http://microsoft.com"), "mediaType"); original.AttributeExtensions.Add(new XmlQualifiedName("name"), "value"); UrlSyndicationContent clone = Assert.IsType <UrlSyndicationContent>(original.Clone()); Assert.NotSame(clone.AttributeExtensions, original.AttributeExtensions); Assert.Equal(1, clone.AttributeExtensions.Count); Assert.Equal("value", clone.AttributeExtensions[new XmlQualifiedName("name")]); Assert.Equal("mediaType", clone.Type); Assert.Equal(new Uri("http://microsoft.com"), clone.Url); }