public void ModelIsValid_Hides() { var model = new TestModel { Name = "hello", }; var html = GetHtmlHelper(model); var response = SrkHtmlExtensions.ValidationSummaryEx(html); var isDisplayed = response != null && response.ToString().Length > 0; Assert.IsFalse(isDisplayed); }
public void ModelIsOtherInvalid_Shows() { var model = new TestModel { Name = "hello", }; var html = GetHtmlHelper(model); html.ViewData.ModelState.AddModelError(string.Empty, "Other error"); var response = SrkHtmlExtensions.ValidationSummaryEx(html); var isDisplayed = response != null && response.ToString().Length > 0; Assert.IsTrue(isDisplayed); }