public void RenderImage_RendersImageWithAttributes()
        {
            GlassHtml html = new GlassHtml("master");

            //Assign
            FieldTypes.Image img = new FieldTypes.Image();
            img.Alt = "Some alt test";
            img.Src = "/cats.jpg";
            img.Class = "classy";

            NameValueCollection attrs = new NameValueCollection();
            attrs.Add("style", "allStyle");
            
            //Act
            var result = html.RenderImage(img, attrs);

            //Assert
            Assert.AreEqual("<img src='/cats.jpg' style='allStyle' class='classy' alt='Some alt test' />", result);

        }
Exemplo n.º 2
0
        public void RenderImage_RendersImageWithAttributes()
        {
            GlassHtml html = new GlassHtml("master");

            //Assign
            FieldTypes.Image img = new FieldTypes.Image();
            img.Alt   = "Some alt test";
            img.Src   = "/cats.jpg";
            img.Class = "classy";

            NameValueCollection attrs = new NameValueCollection();

            attrs.Add("style", "allStyle");

            //Act
            var result = html.RenderImage(img, attrs);

            //Assert
            Assert.AreEqual("<img src='/cats.jpg' style='allStyle' class='classy' alt='Some alt test' />", result);
        }