public void RenderDataCellForMultiSelect() { var row = new BocListRow(1, BusinessObject); List.Stub(mock => mock.Selection).Return(RowSelection.Multiple); List.Stub(mock => mock.GetSelectorControlValue(row)).Return("row1"); IBocSelectorColumnRenderer renderer = new BocSelectorColumnRenderer(RenderingFeatures.Default, _bocListCssClassDefinition); renderer.RenderDataCell( _bocListRenderingContext, new BocListRowRenderingContext(row, 0, false), "bocListTableCell"); var document = Html.GetResultDocument(); var td = Html.GetAssertedChildElement(document, "td", 0); Html.AssertAttribute(td, "class", "bocListTableCell"); var input = Html.GetAssertedChildElement(td, "input", 0); Html.AssertAttribute(input, "type", "checkbox"); Html.AssertAttribute(input, "id", "SelectRowControl_UnqiueID_1"); Html.AssertAttribute(input, "name", "SelectRowControl$UnqiueID"); Html.AssertAttribute(input, "value", "row1"); Html.AssertAttribute(input, "alt", "Select this row"); }
public void RenderTitleCellForSingleSelect() { List.Stub(mock => mock.Selection).Return(RowSelection.SingleRadioButton); IBocSelectorColumnRenderer renderer = new BocSelectorColumnRenderer(RenderingFeatures.Default, _bocListCssClassDefinition); renderer.RenderTitleCell(_bocListRenderingContext); var document = Html.GetResultDocument(); var th = Html.GetAssertedChildElement(document, "th", 0); Html.AssertAttribute(th, "class", _bocListCssClassDefinition.TitleCell); Html.AssertTextNode(th, HtmlHelper.WhiteSpace, 0); }
public void TestDiagnosticMetadataRenderingInTitleCell() { List.Stub(mock => mock.Selection).Return(RowSelection.Multiple); IBocSelectorColumnRenderer renderer = new BocSelectorColumnRenderer(RenderingFeatures.WithDiagnosticMetadata, _bocListCssClassDefinition); renderer.RenderTitleCell(_bocListRenderingContext); var document = Html.GetResultDocument(); var th = Html.GetAssertedChildElement(document, "th", 0); Html.AssertAttribute(th, DiagnosticMetadataAttributesForObjectBinding.BocListCellIndex, 1.ToString()); var input = Html.GetAssertedChildElement(th, "input", 0); Html.AssertAttribute(input, DiagnosticMetadataAttributesForObjectBinding.BocListWellKnownSelectAllControl, "true"); }
public void TestDiagnosticMetadataRenderingInDataCell() { var row = new BocListRow(1, BusinessObject); List.Stub(mock => mock.Selection).Return(RowSelection.SingleRadioButton); List.Stub(mock => mock.GetSelectorControlValue(row)).Return("row1"); IBocSelectorColumnRenderer renderer = new BocSelectorColumnRenderer(RenderingFeatures.WithDiagnosticMetadata, _bocListCssClassDefinition); renderer.RenderDataCell( _bocListRenderingContext, new BocListRowRenderingContext(row, 0, false), "bocListTableCell"); var document = Html.GetResultDocument(); var td = Html.GetAssertedChildElement(document, "td", 0); Html.AssertAttribute(td, DiagnosticMetadataAttributesForObjectBinding.BocListCellIndex, 1.ToString()); }
public void RenderTitleCellForMultiSelect() { List.Stub(mock => mock.Selection).Return(RowSelection.Multiple); IBocSelectorColumnRenderer renderer = new BocSelectorColumnRenderer(RenderingFeatures.Default, _bocListCssClassDefinition); renderer.RenderTitleCell(_bocListRenderingContext); var document = Html.GetResultDocument(); var th = Html.GetAssertedChildElement(document, "th", 0); Html.AssertAttribute(th, "class", _bocListCssClassDefinition.TitleCell); var input = Html.GetAssertedChildElement(th, "input", 0); Html.AssertAttribute(input, "type", "checkbox"); Html.AssertAttribute(input, "name", List.GetSelectAllControlName()); Html.AssertNoAttribute(input, "value"); Html.AssertAttribute(input, "alt", "Select all rows"); }