예제 #1
0
        public async Task If_has_content_should_only_render_td()
        {
            // arrange
            var tag = new TdTagHelper
            {
                For             = MakeExpression(_model, m => m.Items[0].Name),
                RequestServices = ServiceProvider
            };

            // act
            var output = await ProcessTagAsync(tag, "miru-td", "Hi");

            // assert
            output.TagName.ShouldBeNull();
            output.PreElement.GetContent().ShouldBe("<td>Hi</td>");
        }
예제 #2
0
        public async Task Should_add_attributes_from_conventions()
        {
            // arrange
            var tag = new TdTagHelper
            {
                For             = MakeExpression(_model, m => m.Items[0].Id),
                RequestServices = ServiceProvider
            };

            // act
            var output = await ProcessTagAsync(tag, "miru-td");

            // assert
            output.TagName.ShouldBeNull();
            output.PreElement.GetContent().ShouldBe("<td><span id=\"Items[0].Id\">1</span></td>");
        }
예제 #3
0
        public async Task If_no_content_should_add_miru_display()
        {
            // arrange
            var tag = new TdTagHelper
            {
                For             = MakeExpression(_model, m => m.Items[0].Name),
                RequestServices = ServiceProvider
            };

            // act
            var output = await ProcessTagAsync(tag, "miru-td");

            // assert
            output.TagName.ShouldBeNull();
            output.PreElement.GetContent().ShouldBe("<td><span id=\"Items[0].Name\">iPhone</span></td>");
        }