Ejemplo n.º 1
0
        public void EnableClientValidation() {
            // Arrange
            var mockViewContext = new Mock<ViewContext>();
            var viewDataContainer = new Mock<IViewDataContainer>().Object;
            var htmlHelper = new HtmlHelper(mockViewContext.Object, viewDataContainer);

            // Act
            htmlHelper.EnableClientValidation();

            // Act & assert
            mockViewContext.VerifySet(vc => vc.ClientValidationEnabled = true);
        }