public void Empty () { TestHyperLink hl = new TestHyperLink (); Assert.AreEqual (String.Empty, hl.ImageUrl, "ImageUrl"); Assert.AreEqual (String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual (String.Empty, hl.Target, "Target"); Assert.AreEqual (String.Empty, hl.Text, "Text"); Assert.AreEqual ("<a></a>", hl.Render (), "Empty"); }
public void Empty() { TestHyperLink hl = new TestHyperLink(); Assert.AreEqual(String.Empty, hl.ImageUrl, "ImageUrl"); Assert.AreEqual(String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual(String.Empty, hl.Target, "Target"); Assert.AreEqual(String.Empty, hl.Text, "Text"); Assert.AreEqual("<a></a>", hl.Render(), "Empty"); }
public void NavigateUrl_NO_ResolveUrl() { TestHyperLink hl = new TestHyperLink(); hl.NavigateUrl = "~/index.html"; Assert.AreEqual(String.Empty, hl.ImageUrl, "ImageUrl"); Assert.AreEqual("~/index.html", hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual(String.Empty, hl.Target, "Target"); Assert.AreEqual(String.Empty, hl.Text, "Text"); // Note: resolve only occurs inside a Page Assert.AreEqual("<a href=\"~/index.html\"></a>", hl.Render(), "Resolve"); }
public void ImageUrlWithoutText() { string origHtml = "<a><img src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" alt=\"\" /></a>"; TestHyperLink hl = new TestHyperLink(); hl.ImageUrl = imageUrl; Assert.AreEqual(imageUrl, hl.ImageUrl, "ImageUrl"); Assert.AreEqual(String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual(String.Empty, hl.Target, "Target"); Assert.AreEqual(String.Empty, hl.Text, "Text"); // an empty alt attribute is begin added string renderedHtml = hl.Render(); Assert.AreEqual(origHtml, renderedHtml, "Empty"); }
public void ImageUrl_NO_ResolveUrl() { string origHtml = "<a><img src=\"~/ben.jpeg\" alt=\"\" /></a>"; TestHyperLink hl = new TestHyperLink(); hl.ImageUrl = "~/ben.jpeg"; Assert.AreEqual("~/ben.jpeg", hl.ImageUrl, "ImageUrl"); Assert.AreEqual(String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual(String.Empty, hl.Target, "Target"); Assert.AreEqual(String.Empty, hl.Text, "Text"); // Note: resolve only occurs inside a Page string renderedHtml = hl.Render(); Assert.AreEqual(origHtml, renderedHtml, "Resolve"); }
public void ImageUrlWithoutText_ToolTip() { #if NET_4_0 string origHtml = "<a title=\"Some message\"><img title=\"Some message\" src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" alt=\"\" /></a>"; #else string origHtml = "<a title=\"Some message\"><img title=\"Some message\" src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" style=\"border-width:0px;\" /></a>"; #endif TestHyperLink hl = new TestHyperLink(); hl.ImageUrl = imageUrl; hl.ToolTip = "Some message"; Assert.AreEqual(imageUrl, hl.ImageUrl, "ImageUrl"); Assert.AreEqual(String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual(String.Empty, hl.Target, "Target"); Assert.AreEqual(String.Empty, hl.Text, "Text"); // an empty alt attribute is begin added string renderedHtml = hl.Render(); Assert.AreEqual(origHtml, renderedHtml, "Empty"); }
public void ImageUrlWithoutText() { TestHyperLink hl = new TestHyperLink(); hl.ImageUrl = imageUrl; Assert.AreEqual(imageUrl, hl.ImageUrl, "ImageUrl"); Assert.AreEqual(String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual(String.Empty, hl.Target, "Target"); Assert.AreEqual(String.Empty, hl.Text, "Text"); // an empty alt attribute is begin added #if NET_2_0 Assert.AreEqual("<a><img src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" style=\"border-width:0px;\" /></a>", hl.Render(), "Empty"); #else Assert.AreEqual("<a><img src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" alt=\"\" border=\"0\" /></a>", hl.Render(), "Empty"); #endif }
public void ImageUrl_NO_ResolveUrl() { TestHyperLink hl = new TestHyperLink(); hl.ImageUrl = "~/ben.jpeg"; Assert.AreEqual("~/ben.jpeg", hl.ImageUrl, "ImageUrl"); Assert.AreEqual(String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual(String.Empty, hl.Target, "Target"); Assert.AreEqual(String.Empty, hl.Text, "Text"); // Note: resolve only occurs inside a Page #if NET_2_0 Assert.AreEqual("<a><img src=\"~/ben.jpeg\" style=\"border-width:0px;\" /></a>", hl.Render(), "Resolve"); #else Assert.AreEqual("<a><img src=\"~/ben.jpeg\" alt=\"\" border=\"0\" /></a>", hl.Render(), "Resolve"); #endif }
public void ImageUrlWithoutText_ToolTip () { string origHtml = "<a title=\"Some message\"><img title=\"Some message\" src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" alt=\"\" /></a>"; TestHyperLink hl = new TestHyperLink (); hl.ImageUrl = imageUrl; hl.ToolTip = "Some message"; Assert.AreEqual (imageUrl, hl.ImageUrl, "ImageUrl"); Assert.AreEqual (String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual (String.Empty, hl.Target, "Target"); Assert.AreEqual (String.Empty, hl.Text, "Text"); // an empty alt attribute is begin added string renderedHtml = hl.Render (); Assert.AreEqual (origHtml, renderedHtml, "Empty"); }
public void ImageUrl_NO_ResolveUrl () { string origHtml = "<a><img src=\"~/ben.jpeg\" alt=\"\" /></a>"; TestHyperLink hl = new TestHyperLink (); hl.ImageUrl = "~/ben.jpeg"; Assert.AreEqual ("~/ben.jpeg", hl.ImageUrl, "ImageUrl"); Assert.AreEqual (String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual (String.Empty, hl.Target, "Target"); Assert.AreEqual (String.Empty, hl.Text, "Text"); // Note: resolve only occurs inside a Page string renderedHtml = hl.Render (); Assert.AreEqual (origHtml, renderedHtml, "Resolve"); }
public void NavigateUrl_NO_ResolveUrl () { TestHyperLink hl = new TestHyperLink (); hl.NavigateUrl = "~/index.html"; Assert.AreEqual (String.Empty, hl.ImageUrl, "ImageUrl"); Assert.AreEqual ("~/index.html", hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual (String.Empty, hl.Target, "Target"); Assert.AreEqual (String.Empty, hl.Text, "Text"); // Note: resolve only occurs inside a Page Assert.AreEqual ("<a href=\"~/index.html\"></a>", hl.Render (), "Resolve"); }
public void ImageUrlWithoutText () { TestHyperLink hl = new TestHyperLink (); hl.ImageUrl = imageUrl; Assert.AreEqual (imageUrl, hl.ImageUrl, "ImageUrl"); Assert.AreEqual (String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual (String.Empty, hl.Target, "Target"); Assert.AreEqual (String.Empty, hl.Text, "Text"); // an empty alt attribute is begin added #if NET_2_0 Assert.AreEqual ("<a><img src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" style=\"border-width:0px;\" /></a>", hl.Render (), "Empty"); #else Assert.AreEqual ("<a><img src=\"http://www.mono-project.com/stylesheets/images.wiki.png\" alt=\"\" border=\"0\" /></a>", hl.Render (), "Empty"); #endif }
public void ImageUrl_NO_ResolveUrl () { TestHyperLink hl = new TestHyperLink (); hl.ImageUrl = "~/ben.jpeg"; Assert.AreEqual ("~/ben.jpeg", hl.ImageUrl, "ImageUrl"); Assert.AreEqual (String.Empty, hl.NavigateUrl, "NavigateUrl"); Assert.AreEqual (String.Empty, hl.Target, "Target"); Assert.AreEqual (String.Empty, hl.Text, "Text"); // Note: resolve only occurs inside a Page #if NET_2_0 Assert.AreEqual ("<a><img src=\"~/ben.jpeg\" style=\"border-width:0px;\" /></a>", hl.Render (), "Resolve"); #else Assert.AreEqual ("<a><img src=\"~/ben.jpeg\" alt=\"\" border=\"0\" /></a>", hl.Render (), "Resolve"); #endif }