コード例 #1
0
            public void ForIsValidAtLevel1()
            {
                var model  = new TestModel();
                var html   = this.GetHtmlHeper <TestModel>(model);
                var result = SrkHtmlExtensions.DescriptionFor(html, m => m.Description2);

                Assert.AreEqual("<span data-for=\"Description2\">Desc a2a</span>", result.ToString().NullIfEmpty());
            }
コード例 #2
0
            public void AcceptsHtmlAttributes()
            {
                var model  = new TestModel();
                var html   = this.GetHtmlHeper <TestModel>(model);
                var result = SrkHtmlExtensions.DescriptionFor(html, m => m.Description2, new { attr1 = "value", });

                Assert.AreEqual("<span attr1=\"value\" data-for=\"Description2\">Desc a2a</span>", result.ToString().NullIfEmpty());
            }
コード例 #3
0
            public void EmptyDescriptionReturnsEmptyString()
            {
                var model  = new TestModel();
                var html   = this.GetHtmlHeper <TestModel>(model);
                var result = SrkHtmlExtensions.DescriptionFor(html, m => m.Description);

                Assert.IsNull(result.ToString().NullIfEmpty());
            }