private static IHtmlNode GetParameterTableRow(ITabularParameterRow row, bool renderRowStatus) { var values = row.Values.Select(GetRowValue).ToList(); if (renderRowStatus) { values.Insert(0, Html.Tag(Html5Tag.Td).Class("param type").Content(GetRowTypeContent(row))); } return(Html.Tag(Html5Tag.Tr).Content(values)); }
private void AddRow(ITabularParameterRow row) { var textRow = new TextRow(row.Type, row.VerificationStatus); for (var i = 0; i < row.Values.Count; i++) { var cell = new TextCell(row.Values[i]); textRow.Add(cell); _columns[i].EnsureFit(cell.Text); } _rows.Add(textRow); }
private void AssertRow(ITabularParameterRow row, TableRowType rowType, ParameterVerificationStatus rowStatus, params string[] expectedValueDetails) { Assert.That(row.Type, Is.EqualTo(rowType)); var actual = row.Values .Select(v => $"{v.VerificationStatus}|{v.Value}|{v.Expectation}|{v.VerificationMessage ?? "null"}") .ToArray(); Assert.That(actual, Is.EqualTo(expectedValueDetails)); Assert.That(row.VerificationStatus, Is.EqualTo(rowStatus)); }
private static XElement ToXElement(ITabularParameterRow row) { var objects = new List <object> { ToXAttribute(row.VerificationStatus), new XAttribute("Type", row.Type.ToString()) }; if (!string.IsNullOrWhiteSpace(row.VerificationMessage)) { objects.Add(new XAttribute("Message", row.VerificationMessage)); } objects.AddRange(row.Values.Select((v, i) => ToXElement(v, i))); return(new XElement("Row", objects)); }
private static string GetRowTypeContent(ITabularParameterRow row) { if (row.Type == TableRowType.Surplus) { return("(surplus)"); } if (row.Type == TableRowType.Missing) { return("(missing)"); } if (row.VerificationStatus == ParameterVerificationStatus.Success) { return("="); } if (row.VerificationStatus == ParameterVerificationStatus.NotApplicable) { return(" "); } return("!"); }