Example #1
0
        public void EndFormTwiceRendersCloseFormTagOnce()
        {
            // Arrange
            Mock <HttpResponseBase> mockHttpResponse = GetHttpResponseForForm();
            MvcForm form = new MvcForm(mockHttpResponse.Object);

            // Act
            form.EndForm();
            form.EndForm();

            // Assert
            mockHttpResponse.Verify();
        }
Example #2
0
        public void EndFormTwiceRendersCloseFormTagOnce()
        {
            // Arrange
            StringWriter writer      = new StringWriter();
            ViewContext  viewContext = GetViewContext(writer);

            MvcForm form = new MvcForm(viewContext);

            // Act
            form.EndForm();
            form.EndForm();

            // Assert
            Assert.Equal("</form>", writer.ToString());
        }
Example #3
0
        public void EndFormTwiceRendersCloseFormTagOnce()
        {
            // Arrange
            StringWriter writer = new StringWriter();
            ViewContext viewContext = GetViewContext(writer);

            MvcForm form = new MvcForm(viewContext);

            // Act
            form.EndForm();
            form.EndForm();

            // Assert
            Assert.Equal("</form>", writer.ToString());
        }
Example #4
0
        public ExampleConfigurator End()
        {
            writer.RenderEndTag(); // fieldset

            if (form != null)
            {
                form.EndForm();
            }

            return(this);
        }
Example #5
0
 public void Dispose()
 {
     form.EndForm();
     helper.ViewContext.Writer.Write(this.html);
 }