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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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()); }
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()); }
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)); }
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)); }
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)); }
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()); }
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()); }