public override void DoRow(Parse row) { if (row.Parts.Size != rowWidth) { TestStatus.MarkException(row.Parts, new RowWidthException(rowWidth)); } else { try { TypedValue result = CellOperation.Invoke(this, memberNameCells, valueCells.GetCells(new CellRange(row.Parts).Cells), row.Parts); if (result.Type != typeof(bool)) { throw new InvalidMethodException(string.Format("Method does not return boolean.")); } if (result.GetValue <bool>() == expectedCondition) { TestStatus.MarkRight(row); } else { TestStatus.MarkWrong(row); } } catch (ParseException <Cell> e) { TestStatus.MarkException(e.Subject, e.InnerException); } } }
public object ExecuteEmbeddedMethod(Parse theCells) { try { CellRange cells = CellRange.GetMethodCellRange(theCells, 0); return (CellOperation.Invoke(this, new CellRange(MethodCells(cells)), new CellRange(ParameterCells(cells)), theCells.More). Value); } catch (ParseException <Cell> e) { TestStatus.MarkException(e.Subject, e.InnerException); throw new IgnoredException(); } }
// Traversal //////////////////////////////// public override void DoCells(Parse cells) { this.cells = cells; try { targetObject = this; CellOperation.Invoke(this, cells); targetObject = actor; } catch (Exception e) { TestStatus.MarkException(cells, e); } }
public override void DoRow(Parse theRow) { try { if (theRow.Parts.Size != headerCells.Size) { throw new FitFailureException(String.Format("Row should be {0} cells wide.", headerCells.Size)); } CellOperation.Invoke(this, new CellRange(headerCells), new CellRange(theRow.Parts), theRow.Parts); } catch (MemberMissingException e) { TestStatus.MarkException(headerCells, e); throw new IgnoredException(); } catch (Exception e) { TestStatus.MarkException(theRow.Parts, e); } }
void AddSurplusRow(Parse rows, object extraObject) { Parse cell = null; SetTargetObject(extraObject); foreach (Parse headerCell in new CellRange(headerCells).Cells) { TypedValue actual = CellOperation.Invoke(this, headerCell); var newCell = (Parse)Processor.Compose(actual.Value ?? "null"); if (cell == null) { cell = newCell; } else { cell.Last.More = newCell; } } AddRowToTable(cell, rows); MarkRowAsSurplus(rows.Last); }
bool IsMatch(Parse row, int col) { TypedValue actual = CellOperation.Invoke(this, headerCells.At(col)); return(CellOperation.Compare(actual, GetCellForColumn(row, col))); }
public static TypedValue Invoke(this CellOperation operation, object target, Tree <Cell> memberName) { return(operation.Invoke(target, memberName, new CellTree())); }
public virtual void Press() { CellOperation.Invoke(actor, cells.More, new CellTree(), cells.More); }