public void DisposeTwiceRendersCloseFormTagOnce() { // Arrange Mock<HttpResponseBase> mockHttpResponse = GetHttpResponseForForm(); MvcForm form = new MvcForm(mockHttpResponse.Object); // Act form.Dispose(); form.Dispose(); // Assert mockHttpResponse.Verify(); }
public void DisposeTwiceRendersCloseFormTagOnce() { // Arrange StringWriter writer = new StringWriter(); ViewContext viewContext = GetViewContext(writer); MvcForm form = new MvcForm(viewContext); // Act form.Dispose(); form.Dispose(); // Assert Assert.AreEqual("</form>", writer.ToString()); }