Ejemplo n.º 1
0
        public void ImageMap_AssignedValues_RenderNavigateCircle()
        {
            // Circle.HotSpotMode = Navigate
            //------------------------------
            PokerImageMap imageMap = new PokerImageMap();

            imageMap.Enabled = true;
            CircleHotSpot circle = new CircleHotSpot();

            circle.AccessKey     = "A";
            circle.AlternateText = "Circle";
            circle.HotSpotMode   = HotSpotMode.Navigate;
            circle.NavigateUrl   = "NavigateURL";
            circle.TabIndex      = 1;
            circle.Radius        = 10;
            circle.X             = 30;
            circle.Y             = 40;
            imageMap.HotSpots.Add(circle);
#if NET_4_0
            string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"30,40,10\" href=\"NavigateURL\" title=\"Circle\" alt=\"Circle\" accesskey=\"A\" tabindex=\"1\" />\r\n</map>";
#else
            string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"30,40,10\" href=\"NavigateURL\" title=\"Circle\" alt=\"Circle\" accesskey=\"A\" tabindex=\"1\" />\r\n</map>";
#endif
            string renderedHtml = imageMap.Render();
            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "RenderNavigateCircleTextAssigned");
        }
Ejemplo n.º 2
0
        public void ImageMap_AssignedValues_RenderNavigateShapes()
        {
            // Rectangle/Polygon.HotSpotMode = Navigate
            //-----------------------------------------
            PokerImageMap imageMap = new PokerImageMap();

            imageMap.Enabled     = true;
            imageMap.HotSpotMode = HotSpotMode.NotSet;
            RectangleHotSpot rect = new RectangleHotSpot();

            rect.AccessKey     = "R";
            rect.AlternateText = "Rectangle";
            rect.HotSpotMode   = HotSpotMode.Navigate;
            rect.NavigateUrl   = "NavigateUrlRect";
            rect.TabIndex      = 1;
            rect.Bottom        = 10;
            rect.Top           = 20;
            rect.Left          = 30;
            rect.Right         = 40;
            imageMap.HotSpots.Add(rect);
            imageMap.HotSpotMode = HotSpotMode.Navigate;
            PolygonHotSpot poly = new PolygonHotSpot();

            poly.AccessKey     = "P";
            poly.AlternateText = "Polygon";
            poly.NavigateUrl   = "NavigateUrlPoly";
            poly.TabIndex      = 2;
            poly.Coordinates   = "10,20,30,40,50,60,100,200";
            imageMap.HotSpots.Add(poly);
            string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\">\r\n\t<area shape=\"rect\" coords=\"30,20,40,10\" href=\"NavigateUrlRect\" title=\"Rectangle\" alt=\"Rectangle\" accesskey=\"R\" tabindex=\"1\" /><area shape=\"poly\" coords=\"10,20,30,40,50,60,100,200\" href=\"NavigateUrlPoly\" title=\"Polygon\" alt=\"Polygon\" accesskey=\"P\" tabindex=\"2\" />\r\n</map>";

            HtmlDiff.AssertAreEqual(imageMap.Render(), originalHtml, "RenderNavigateShapesTextAssigned");
        }
Ejemplo n.º 3
0
        public void ImageMap_Defaults_Render()
        {
            PokerImageMap imageMap     = new PokerImageMap();
            string        originalHtml = "<img src=\"\" style=\"border-width:0px;\" />";

            HtmlDiff.AssertAreEqual(imageMap.Render(), originalHtml, "RenderDefault");
        }
Ejemplo n.º 4
0
        public void ImageMap_Defaults_Render()
        {
            PokerImageMap imageMap     = new PokerImageMap();
            string        originalHtml = "<img src=\"\" />";
            string        renderedHtml = imageMap.Render();

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "RenderDefault");
        }
Ejemplo n.º 5
0
        public void ImageMap_Defaults_Render()
        {
            PokerImageMap imageMap = new PokerImageMap();

#if NET_4_0
            string originalHtml = "<img src=\"\" />";
#else
            string originalHtml = "<img src=\"\" style=\"border-width:0px;\" />";
#endif
            string renderedHtml = imageMap.Render();
            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "RenderDefault");
        }
Ejemplo n.º 6
0
        public void ImageMap_AssignedValues_RenderInactive()
        {
            // HotSpotMode = Inactive
            //-----------------------
            PokerImageMap imageMap = new PokerImageMap();

            imageMap.Enabled     = true;
            imageMap.HotSpotMode = HotSpotMode.Inactive;
            imageMap.Target      = "Target";
            imageMap.HotSpots.Add(new CircleHotSpot());
            string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" nohref=\"true\" title=\"\" alt=\"\" />\r\n</map>";

            HtmlDiff.AssertAreEqual(imageMap.Render(), originalHtml, "RenderInaciveTextAssigned");
        }
Ejemplo n.º 7
0
        public void ImageMap_AssignedValues_RenderDisabled()
        {
            // Enabled = false
            //----------------
            PokerImageMap imageMap = new PokerImageMap();

            imageMap.Enabled     = false;
            imageMap.HotSpotMode = HotSpotMode.Navigate;
            imageMap.Target      = "Target";
            CircleHotSpot circle = new CircleHotSpot();

            circle.NavigateUrl = "NavigateURL";
            imageMap.HotSpots.Add(circle);
            string originalHtml = "<img disabled=\"disabled\" src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" href=\"NavigateURL\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";

            HtmlDiff.AssertAreEqual(imageMap.Render(), originalHtml, "RenderDisabledTextAssigne");
        }
Ejemplo n.º 8
0
        public void ImageMap_AssignedValues_RenderNavigate()
        {
            // HotSpotMode = Navigate using NavigateURL
            //-----------------------------------------
            PokerImageMap imageMap = new PokerImageMap();

            imageMap.Enabled     = true;
            imageMap.HotSpotMode = HotSpotMode.Navigate;
            imageMap.Target      = "Target";
            CircleHotSpot circle = new CircleHotSpot();

            circle.NavigateUrl = "NavigateURL";
            imageMap.HotSpots.Add(circle);
            string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" href=\"NavigateURL\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
            string renderedHtml = imageMap.Render();

            HtmlDiff.AssertAreEqual(originalHtml, renderedHtml, "RenderNavigateTextAssigned");
        }
Ejemplo n.º 9
0
		public void ImageMap_AssignedValues_RenderDisabled ()
		{
			// Enabled = false
			//----------------
			PokerImageMap imageMap = new PokerImageMap ();
			imageMap.Enabled = false;
			imageMap.HotSpotMode = HotSpotMode.Navigate;
			imageMap.Target = "Target";
			CircleHotSpot circle = new CircleHotSpot ();
			circle.NavigateUrl = "NavigateURL";
			imageMap.HotSpots.Add (circle);
			string originalHtml = "<img class=\"aspNetDisabled\" src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
			string renderedHtml = imageMap.Render ();
			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderDisabledTextAssigne");
		}
Ejemplo n.º 10
0
		public void ImageMap_AssignedValues_RenderInactive ()
		{
			// HotSpotMode = Inactive
			//-----------------------
			PokerImageMap imageMap = new PokerImageMap ();
			imageMap.Enabled = true;
			imageMap.HotSpotMode = HotSpotMode.Inactive;
			imageMap.Target = "Target";
			imageMap.HotSpots.Add (new CircleHotSpot ());
			string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" nohref=\"true\" title=\"\" alt=\"\" />\r\n</map>";
			string renderedHtml = imageMap.Render ();
			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderInaciveTextAssigned");
		}
Ejemplo n.º 11
0
		public void ImageMap_AssignedValues_RenderNavigateShapes ()
		{
			// Rectangle/Polygon.HotSpotMode = Navigate 
			//-----------------------------------------
			PokerImageMap imageMap = new PokerImageMap ();
			imageMap.Enabled = true;
			imageMap.HotSpotMode = HotSpotMode.NotSet;
			RectangleHotSpot rect = new RectangleHotSpot ();
			rect.AccessKey = "R";
			rect.AlternateText = "Rectangle";
			rect.HotSpotMode = HotSpotMode.Navigate;
			rect.NavigateUrl = "NavigateUrlRect";
			rect.TabIndex = 1;
			rect.Bottom = 10;
			rect.Top = 20;
			rect.Left = 30;
			rect.Right = 40;
			imageMap.HotSpots.Add (rect);
			imageMap.HotSpotMode = HotSpotMode.Navigate;
			PolygonHotSpot poly = new PolygonHotSpot ();
			poly.AccessKey = "P";
			poly.AlternateText = "Polygon";
			poly.NavigateUrl = "NavigateUrlPoly";
			poly.TabIndex = 2;
			poly.Coordinates = "10,20,30,40,50,60,100,200";
			imageMap.HotSpots.Add (poly);
			string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"rect\" coords=\"30,20,40,10\" href=\"NavigateUrlRect\" title=\"Rectangle\" alt=\"Rectangle\" accesskey=\"R\" tabindex=\"1\" /><area shape=\"poly\" coords=\"10,20,30,40,50,60,100,200\" href=\"NavigateUrlPoly\" title=\"Polygon\" alt=\"Polygon\" accesskey=\"P\" tabindex=\"2\" />\r\n</map>";
			string renderedHtml = imageMap.Render ();
			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateShapesTextAssigned");
		}
Ejemplo n.º 12
0
		public void ImageMap_AssignedValues_RenderNavigateCircle ()
		{
			// Circle.HotSpotMode = Navigate
			//------------------------------
			PokerImageMap imageMap = new PokerImageMap ();
			imageMap.Enabled = true;
			CircleHotSpot circle = new CircleHotSpot ();
			circle.AccessKey = "A";
			circle.AlternateText = "Circle";
			circle.HotSpotMode = HotSpotMode.Navigate;
			circle.NavigateUrl = "NavigateURL";
			circle.TabIndex = 1;
			circle.Radius = 10;
			circle.X = 30;
			circle.Y = 40;
			imageMap.HotSpots.Add (circle);
			string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"30,40,10\" href=\"NavigateURL\" title=\"Circle\" alt=\"Circle\" accesskey=\"A\" tabindex=\"1\" />\r\n</map>";
			string renderedHtml = imageMap.Render ();
			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateCircleTextAssigned");
		}
Ejemplo n.º 13
0
		public void ImageMap_Defaults_Render ()
		{
			PokerImageMap imageMap = new PokerImageMap ();
			string originalHtml = "<img src=\"\" />";
			string renderedHtml = imageMap.Render ();
			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderDefault");
		}
Ejemplo n.º 14
0
		public void ImageMap_AssignedValues_RenderNavigate ()
		{
			// HotSpotMode = Navigate using NavigateURL
			//-----------------------------------------
			PokerImageMap imageMap = new PokerImageMap ();
			imageMap.Enabled = true;
			imageMap.HotSpotMode = HotSpotMode.Navigate;
			imageMap.Target = "Target";
			CircleHotSpot circle = new CircleHotSpot ();
			circle.NavigateUrl = "NavigateURL";
			imageMap.HotSpots.Add (circle);
#if NET_4_0
			string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" href=\"NavigateURL\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
#else
			string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" href=\"NavigateURL\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
#endif
			string renderedHtml = imageMap.Render ();
			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateTextAssigned");
		}
Ejemplo n.º 15
0
		public void ImageMap_Defaults_Render ()
		{
			PokerImageMap imageMap = new PokerImageMap ();
#if NET_4_0
			string originalHtml = "<img src=\"\" />";
#else
			string originalHtml = "<img src=\"\" style=\"border-width:0px;\" />";
#endif
			string renderedHtml = imageMap.Render ();
			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderDefault");
		}
Ejemplo n.º 16
0
		public void ImageMap_Defaults_Render ()
		{
			PokerImageMap imageMap = new PokerImageMap ();
			string originalHtml = "<img src=\"\" style=\"border-width:0px;\" />";
			HtmlDiff.AssertAreEqual (imageMap.Render (), originalHtml, "RenderDefault");
		}