Ejemplo n.º 1
0
        public void TestOnClick()
        {
            var attributes = new TagHelperAttributeList {
                { "asp-click", "a" }
            };
            var result = new String();

            result.Append("<button (click)=\"a\" mat-raised-button=\"mat-raised-button\"></button>");
            Assert.Equal(result.ToString(), GetResult(_button, attributes));
        }
Ejemplo n.º 2
0
        public void TestAttribute_2()
        {
            var attributes = new TagHelperAttributeList {
                { "a", "1" }
            };
            var result = new String();

            result.Append("<button a=\"1\" mat-raised-button=\"mat-raised-button\"></button>");
            Assert.Equal(result.ToString(), GetResult(_button, outputAttributes: attributes));
        }
Ejemplo n.º 3
0
        public void TestText()
        {
            TagHelperContent content = new DefaultTagHelperContent();

            content.SetContent("a");
            var result = new String();

            result.Append("<button mat-raised-button=\"mat-raised-button\">a</button>");
            Assert.Equal(result.ToString(), GetResult(_button, content: content));
        }
Ejemplo n.º 4
0
        public void TestPlain()
        {
            var attributes = new TagHelperAttributeList {
                { "asp-plain", "true" }
            };
            var result = new String();

            result.Append("<button mat-button=\"mat-button\"></button>");
            Assert.Equal(result.ToString(), GetResult(_button, attributes));
        }
Ejemplo n.º 5
0
        public void TestId()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Id, "b" }
            };
            var result = new String();

            result.Append("<a #b=\"\" #m_b=\"routerLinkActive\" mat-tab-link=\"\" routerLinkActive=\"\" [active]=\"m_b.isActive\"></a>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 6
0
        public void TestBindLink()
        {
            var attributes = new TagHelperAttributeList {
                { AngularConst.BindLink, "b" }
            };
            var result = new String();

            result.Append("<a #m_id=\"routerLinkActive\" mat-tab-link=\"\" routerLinkActive=\"\" [active]=\"m_id.isActive\" [routerLink]=\"b\"></a>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 7
0
        public void TestLabel_MaterialIcon()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Label, "a" }, { UiConst.MaterialIcon, MaterialIcon.Add }
            };
            var result = new String();

            result.Append("<a #m_id=\"routerLinkActive\" mat-tab-link=\"\" routerLinkActive=\"\" [active]=\"m_id.isActive\"><mat-icon>add</mat-icon>a</a>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 8
0
        public void TestDisabled()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Disabled, "a" }
            };
            var result = new String();

            result.Append("<a #m_id=\"routerLinkActive\" mat-tab-link=\"\" routerLinkActive=\"\" [active]=\"m_id.isActive\" [disabled]=\"a\"></a>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 9
0
        public void TestFontAwesomeIcon()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.FontAwesomeIcon, FontAwesomeIcon.Bus }
            };
            var result = new String();

            result.Append("<a #m_id=\"routerLinkActive\" mat-tab-link=\"\" routerLinkActive=\"\" [active]=\"m_id.isActive\"><i class=\"fa fa-bus\"></i></a>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 10
0
        public void TestLabel()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Label, "label" }
            };
            var result = new String();

            result.Append("<a #m_id=\"routerLinkActive\" mat-tab-link=\"\" routerLinkActive=\"\" [active]=\"m_id.isActive\">label</a>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 11
0
        public void TestTotalLimit()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.TotalLimit, 2 }
            };
            var result = new String();

            result.Append("<nz-upload-wrapper #m_id=\"\">");
            result.Append("<nz-upload (nzChange)=\"m_id.handleChange($event)\" [(nzFileList)]=\"m_id.files\" [nzFilter]=\"m_id.filters\" ");
            result.Append("[nzShowButton]=\"!m_id.files||(m_id.files&&m_id.files).length<2\">");
            result.Append("<x-button text=\"上传\">");
            result.Append("<ng-template>");
            result.Append("<i nz-icon=\"\" nzType=\"upload\"></i>");
            result.Append("</ng-template>");
            result.Append("</x-button>");
            result.Append("</nz-upload>");
            result.Append("</nz-upload-wrapper>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 12
0
        public void TestBindDeleteUrl()
        {
            var attributes = new TagHelperAttributeList {
                { AngularConst.BindDeleteUrl, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [deleteUrl]=\"a\">");
            result.Append("<nz-table #m_id=\"\" (nzPageIndexChange)=\"m_id_wrapper.pageIndexChange($event)\" (nzPageSizeChange)=\"m_id_wrapper.pageSizeChange($event)\" ");
            result.Append("[nzData]=\"m_id_wrapper.dataSource\" [nzFrontPagination]=\"false\" [nzShowPagination]=\"m_id_wrapper.showPagination\" ");
            result.Append("[nzShowSizeChanger]=\"true\" [nzTotal]=\"m_id_wrapper.totalCount\">");
            result.Append("<tbody>");
            result.Append("<tr *ngFor=\"let row of m_id.data\">");
            result.Append("</tr>");
            result.Append("</tbody>");
            result.Append("</nz-table>");
            result.Append("</nz-table-wrapper>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 13
0
        public void TestId()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Id, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #a_wrapper=\"\">");
            result.Append("<nz-table #a=\"\" (nzPageIndexChange)=\"a_wrapper.pageIndexChange($event)\" (nzPageSizeChange)=\"a_wrapper.pageSizeChange($event)\" ");
            result.Append("[nzData]=\"a_wrapper.dataSource\" [nzFrontPagination]=\"false\" [nzLoading]=\"a_wrapper.loading\" [nzShowPagination]=\"a_wrapper.showPagination\" ");
            result.Append("[nzShowSizeChanger]=\"true\" [nzTotal]=\"a_wrapper.totalCount\">");
            result.Append("<tbody>");
            result.Append("<tr *ngFor=\"let row of a.data\">");
            result.Append("</tr>");
            result.Append("</tbody>");
            result.Append("</nz-table>");
            result.Append("</nz-table-wrapper>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 14
0
        public void TestOnLoad()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.OnLoad, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" (onLoad)=\"a\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 15
0
        public void TestAutoLoad()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.AutoLoad, false }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [autoLoad]=\"false\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 16
0
        public void TestCheckedKeys()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.CheckedKeys, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [checkedKeys]=\"a\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 17
0
        public void TestBindDeleteUrl()
        {
            var attributes = new TagHelperAttributeList {
                { AngularConst.BindDeleteUrl, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [deleteUrl]=\"a\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 18
0
        public void TestShowPagination()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.ShowPagination, true }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [showPagination]=\"true\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 19
0
        public void TestData()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Data, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [dataSource]=\"a\" [loading]=\"false\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 20
0
        public void TestQueryParam()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.QueryParam, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [(queryParam)]=\"a\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 21
0
        public void TestMultiple()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Multiple, "a" }
            };
            var result = new String();

            result.Append("<nz-tree-table-wrapper #m_id_wrapper=\"\" [multiple]=\"a\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 22
0
        public void TestShowCheckbox()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.ShowCheckbox, false }
            };
            var result = new String();

            result.Append("<nz-tree-table-wrapper #m_id_wrapper=\"\" [showCheckbox]=\"false\">");
            AppendTableHtml(result);
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 23
0
        public void TestDocumentTypes_Doc()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.DocumentTypes, new List <DocumentType> {
                      DocumentType.Doc
                  } }
            };
            var result = new String();

            result.Append("<nz-upload-wrapper #m_id=\"\">");
            result.Append("<nz-upload (nzChange)=\"m_id.handleChange($event)\" nzAccept=\".doc,.docx\" ");
            result.Append("[(nzFileList)]=\"m_id.files\" [nzFilter]=\"m_id.filters\">");
            result.Append("<x-button text=\"上传\">");
            result.Append("<ng-template>");
            result.Append("<i nz-icon=\"\" nzType=\"upload\"></i>");
            result.Append("</ng-template>");
            result.Append("</x-button>");
            result.Append("</nz-upload>");
            result.Append("</nz-upload-wrapper>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 24
0
        public void TestSelect_9()
        {
            //结果
            var result = new String();

            result.Append("Select [a].[b] As [c],[a1],[b2],");
            result.Append("d=(select a from t),");
            result.Append("[a].[Email],[a].[IntValue],");
            result.Append("e=(select b from t),");
            result.Append("[b].[Description],[b].[Display],");
            result.AppendLine("f=(select c from t) ");
            result.Append("From (select * from t1) as o");

            //执行
            _builder.Select("a.b as c,a1,b2")
            .AppendSelect("d=(select a from t)")
            .Select <Sample>(t => new object[] { t.Email, t.IntValue }, "a")
            .AppendSelect("e=(select b from t)")
            .Select <Sample2>(t => new object[] { t.Description, t.Display }, "b")
            .AppendSelect("f=(select c from t)")
            .From("b")
            .AppendFrom("(select * from t1) ")
            .AppendFrom("as o");


            //验证
            Assert.Equal(result.ToString(), _builder.ToSql());
        }
Ejemplo n.º 25
0
        public void TestDefault()
        {
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\">");
            result.Append("<nz-table #m_id=\"\" [nzData]=\"m_id_wrapper.dataSource\" [nzTotal]=\"m_id_wrapper.totalCount\">");
            result.Append("<tbody>");
            result.Append("<tr *ngFor=\"let row of m_id.data\">");
            result.Append("</tr>");
            result.Append("</tbody>");
            result.Append("</nz-table>");
            result.Append("</nz-table-wrapper>");
            Assert.Equal(result.ToString(), GetResult());
        }
Ejemplo n.º 26
0
        public void TestUrl()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.Url, "a" }
            };
            var result = new String();

            result.Append("<nz-upload-wrapper #m_id=\"\">");
            result.Append("<nz-upload (nzChange)=\"m_id.handleChange($event)\" nzAction=\"a\" [(nzFileList)]=\"m_id.files\" [nzFilter]=\"m_id.filters\">");
            result.Append("<x-button text=\"上传\">");
            result.Append("<ng-template>");
            result.Append("<i nz-icon=\"\" nzType=\"upload\"></i>");
            result.Append("</ng-template>");
            result.Append("</x-button>");
            result.Append("</nz-upload>");
            result.Append("</nz-upload-wrapper>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 27
0
        public void TestQueryParam()
        {
            var attributes = new TagHelperAttributeList {
                { UiConst.QueryParam, "a" }
            };
            var result = new String();

            result.Append("<nz-table-wrapper #m_id_wrapper=\"\" [(queryParam)]=\"a\">");
            result.Append("<nz-table #m_id=\"\" [nzData]=\"m_id_wrapper.dataSource\" [nzShowPagination]=\"m_id_wrapper.showPagination\" ");
            result.Append("[nzTotal]=\"m_id_wrapper.totalCount\">");
            result.Append("<tbody>");
            result.Append("<tr *ngFor=\"let row of m_id.data\">");
            result.Append("</tr>");
            result.Append("</tbody>");
            result.Append("</nz-table>");
            result.Append("</nz-table-wrapper>");
            Assert.Equal(result.ToString(), GetResult(attributes));
        }
Ejemplo n.º 28
0
        public void TestAttribute_3()
        {
            var contextAttributes = new TagHelperAttributeList {
                { "id", "1" }, { "a", "2" }
            };
            var outputAttributes = new TagHelperAttributeList {
                { "a", "2" }
            };
            var result = new String();

            result.Append("<button a=\"2\" id=\"1\" mat-raised-button=\"mat-raised-button\"></button>");
            Assert.Equal(result.ToString(), GetResult(_button, contextAttributes, outputAttributes));
        }
Ejemplo n.º 29
0
        public void TestSelect_2()
        {
            //结果
            var result = new String();

            result.AppendLine("Select [a] ");
            result.Append("From [b] As [c]");

            //执行
            _builder.Select("a").From("b", "c");

            //验证
            Assert.Equal(result.ToString(), _builder.ToSql());
        }
Ejemplo n.º 30
0
        public void TestFrom_5()
        {
            //结果
            var result = new String();

            result.AppendLine("Select * ");
            result.Append("From [b].[Sample] As [a]");

            //执行
            _builder.From <Sample>("a", "b");

            //验证
            Assert.Equal(result.ToString(), _builder.ToSql());
        }