예제 #1
0
		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");
		}
예제 #2
0
        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");
        }
예제 #3
0
        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");
        }
예제 #4
0
        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");
        }
예제 #5
0
        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");
        }
예제 #6
0
        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");
        }
예제 #7
0
        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
        }
예제 #8
0
        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
        }
예제 #9
0
		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");
		}
예제 #10
0
		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");
		}
예제 #11
0
		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
		}