public TypedValue Check(CellOperationValue actualValue, Tree<Cell> expectedCell) { var actualCell = Processor.Compose(actualValue.GetTypedActual(Processor)); expectedCell.Value.AddToAttribute(CellAttribute.InformationSuffix, actualCell.Value.Text.Length == 0 ? "blank" : actualCell.Value.Text); // slightly quirky behavior from original fitnesse.net return TypedValue.Void; }
void CheckEventuallyMatches(CellOperationValue actualValue, Tree<Cell> expectedCell) { var wait = Processor.Get<Symbols>().GetValueOrDefault<int>("WaitFor.Time", defaultWaitTime); var maxCount = Processor.Get<Symbols>().GetValueOrDefault<int>("WaitFor.Count", defaultWaitCount); var sleep = 0; TypedValue actual = TypedValue.Void; for (var count = 0; count < maxCount; count++) { Processor.Get<Logging>().BeginCell(expectedCell.Value); try { actual = actualValue.GetTypedActual(Processor); } finally { Processor.Get<Logging>().EndCell(expectedCell.Value); } if (Processor.Compare(actual,expectedCell)) { Processor.TestStatus.MarkRight(expectedCell.Value); return; } var sleepThisTime = (wait*count)/maxCount - sleep; if (sleepThisTime <= 0) continue; Thread.Sleep(sleepThisTime); sleep += sleepThisTime; } var actualCell = Processor.Compose(actual); Processor.TestStatus.MarkWrong(expectedCell.Value, actualCell.Value.Text); }
public TypedValue Check(CellOperationValue actualValue, Tree<Cell> expectedCell) { try { var actual = actualValue.GetTypedActual(Processor); if (Processor.Compare(actual, expectedCell)) { Processor.TestStatus.MarkRight(expectedCell.Value); } else { var actualCell = Processor.Compose(actual); Processor.TestStatus.MarkWrong(expectedCell.Value, actualCell.Value.Text); } } catch (IgnoredException) {} Processor.TestStatus.MarkCellWithLastResults(expectedCell); return TypedValue.Void; }
public class ParseModelOperator : CellOperator, CheckOperator, ParseOperator <Cell> { // todo: split, eliminate fit dependency public bool CanCheck(CellOperationValue actualValue, Tree <Cell> expectedCell) { return(typeof(Parse).IsAssignableFrom(actualValue.GetTypedActual(Processor).Type)); }