public void right(ICellWrapper <Parse> expected, RestDataTypeAdapter typeAdapter) { string expectedContent = expected.body(); expected.body(Tools.HtmlTools.makeContentForRightCell(expectedContent, typeAdapter, this, minLenForToggle)); fixture.Right(expected.Wrapped); }
public void wrong(ICellWrapper <String> expected, RestDataTypeAdapter ta) { string expectedContent = expected.body(); expected.body(Tools.HtmlTools.makeContentForWrongCell(expectedContent, ta, this, minLenForToggle)); expected.body("fail:" + HtmlTools.wrapInDiv(expected.body())); }
public override void DoCells(Parse parse) { if (restFixture == null) { restFixture = new CommonRestFixture <Parse>(this.Symbols); restFixture.Config = Config.getConfig(ConfigNameFromArgs); string url = BaseUrlFromArgs; if (url != null) { restFixture.BaseUrl = new Url(HtmlTools.fromSimpleTag(url)); } restFixture.initialize(Runner.FIT); ((FitFormatter)restFixture.Formatter).ActionFixtureDelegate = this; } IRowWrapper <Parse> currentRow = new FitRow(parse); try { restFixture.Formatter.DisplayActual = restFixture.displayActualOnRight; restFixture.processRow(currentRow); } catch (Exception exception) { // TODO: Sort out CellWrapper vs CellWrapper<Parse>. ICellWrapper <Parse> firstCell = currentRow.getCell(0); LOG.Error(exception, "Exception when processing row {0}", firstCell.text()); ICellFormatter <Parse> cellFormatter = restFixture.Formatter; cellFormatter.exception(firstCell, exception); } }
public void wrong(ICellWrapper <Parse> expected, RestDataTypeAdapter typeAdapter) { string expectedContent = expected.body(); string body = Tools.HtmlTools.makeContentForWrongCell(expectedContent, typeAdapter, this, minLenForToggle); expected.body(body); fixture.Wrong(expected.Wrapped); }
public void exception(ICellWrapper <String> cell, Exception exception) { //String m = Tools.toHtml(cell.getWrapped() + "\n-----\n") + Tools.toCode(Tools.toHtml(out.toString())); string m = HtmlTools.toHtml(cell.Wrapped + "\n-----\n") + HtmlTools.toCode(HtmlTools.toHtml(exception.ToString())); cell.body("error:" + HtmlTools.wrapInDiv(m)); //cell.body("error:" + m); }
public virtual ICellWrapper <string> removeCell(int c) { if (c < this.row.Count) { ICellWrapper <string> removedCell = this.row[c]; this.row.Remove(removedCell); return(removedCell); } return(null); }
/// <param name="c"> the cell index </param> /// <returns> the <seealso cref="ICellWrapper{T}"/> at a given position </returns> public ICellWrapper <string> getCell(int c) { ICellWrapper <string> cellWrapper = Mock.Of <ICellWrapper <string> >(wrapper => wrapper.Wrapped == _cells[c] && wrapper.text() == _cells[c] && wrapper.body() == _cells[c]); return(cellWrapper); }
public void asLink(ICellWrapper <Parse> cell, string resolvedUrl, string link, string text) { string actualText = text; string parsed = null; if (displayAbsoluteURLInFull) { parsed = HtmlTools.fromSimpleTag(resolvedUrl); if (parsed.Trim().StartsWith("http", StringComparison.Ordinal)) { actualText = parsed; } } cell.body(HtmlTools.toHtmlLink(link, actualText)); }
public void check(ICellWrapper <Parse> expected, RestDataTypeAdapter actual) { if (string.IsNullOrWhiteSpace(expected.body())) { if (actual.Actual == null) { return; } else { expected.body(gray(actual.Actual.ToString())); return; } } if (actual.Actual != null && actual.Equals(expected.body(), actual.Actual.ToString())) { right(expected, actual); } else { wrong(expected, actual); } }
public void exception(ICellWrapper <Parse> cell, Exception exception) { Parse wrapped = cell.Wrapped; fixture.Exception(wrapped, exception); }
public void exception(ICellWrapper <Parse> cell, string exceptionMessage) { Parse wrapped = cell.Wrapped; fixture.Exception(wrapped, new FitFailureException(exceptionMessage)); }
public void exception(ICellWrapper <String> cell, string exceptionMessage) { cell.body("error:" + HtmlTools.wrapInDiv(exceptionMessage)); }
public void right(ICellWrapper <String> expected, RestDataTypeAdapter typeAdapter) { expected.body("pass:" + HtmlTools.wrapInDiv(Tools.HtmlTools.makeContentForRightCell(expected.body(), typeAdapter, this, minLenForToggle))); }