コード例 #1
0
            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);
            }
コード例 #2
0
            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);
            }