Example #1
0
 public void FormHandler_CurrentRenderingNotNull_ShouldReturnHiddenInput(HtmlHelper helper)
 {
   var id = Guid.NewGuid();
   ContextService.Get().Push(new RenderingContext() {Rendering =  new Rendering() {UniqueId = id} });
   helper.Sitecore().CurrentRendering.Should().NotBeNull();
   var xml = XDocument.Parse(helper.FormHandler().ToString());
   xml.Root.Name.LocalName.Should().Be("input");
   xml.Root.GetAttributeValue("name").Should().Be("uid");
   Guid.Parse(xml.Root.GetAttributeValue("value")).Should().Be(id);
 }
Example #2
0
        public void FormHandler_CurrentRenderingNotNull_ShouldReturnHiddenInput(HtmlHelper helper)
        {
            var id = Guid.NewGuid();

            ContextService.Get().Push(new RenderingContext()
            {
                Rendering = new Rendering()
                {
                    UniqueId = id
                }
            });
            helper.Sitecore().CurrentRendering.Should().NotBeNull();
            var xml = XDocument.Parse(helper.FormHandler().ToString());

            xml.Root.Name.LocalName.Should().Be("input");
            xml.Root.GetAttributeValue("name").Should().Be("uid");
            Guid.Parse(xml.Root.GetAttributeValue("value")).Should().Be(id);
        }
Example #3
0
 public void FormHandler_CurrentRenderingNull_ShouldReturnNull(HtmlHelper helper)
 {
   helper.FormHandler().Should().BeNull();
 }
Example #4
0
 public void FormHandler_CurrentRenderingNull_ShouldReturnNull(HtmlHelper helper)
 {
     helper.FormHandler().Should().BeNull();
 }