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);
        }
Beispiel #2
0
        public TypedValue Check(CellOperationValue actualValue, Tree <Cell> expectedCell)
        {
            try {
                Processor.Get <Logging>().BeginCell(expectedCell.Value);
                TypedValue actual;
                try {
                    actual = actualValue.GetTypedActual(Processor);
                }
                finally {
                    Processor.Get <Logging>().EndCell(expectedCell.Value);
                }

                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.Value);
            return(TypedValue.Void);
        }
Beispiel #3
0
        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);
        }
        public TypedValue Check(CellOperationValue actualValue, Tree <Cell> expectedCell)
        {
            var value = actualValue.GetActual(Processor);

            Processor.Get <Symbols>().Save(expectedCell.Value.Text.Substring(2), value);

            expectedCell.Value.SetAttribute(CellAttribute.InformationSuffix, value == null ? "null" : value.ToString());
            return(TypedValue.Void);
        }
 public TypedValue Check(CellOperationValue actualValue, Tree <Cell> expectedCell)
 {
     try {
         CheckEventuallyMatches(actualValue, expectedCell);
     }
     catch (IgnoredException) {}
     Processor.TestStatus.MarkCellWithLastResults(expectedCell.Value);
     return(TypedValue.Void);
 }
Beispiel #6
0
        public TypedValue Check(CellOperationValue actualValue, Tree <Cell> expectedCell)
        {
            var value  = actualValue.GetActual(Processor);
            var symbol = new Symbol(expectedCell.Value.Text.Substring(2), value);

            Processor.Store(symbol);

            expectedCell.Value.AddToAttribute(CellAttribute.InformationSuffix, value == null ? "null" : value.ToString());
            return(TypedValue.Void);
        }
 void DoCheckOperation(FlowInterpreter interpreter, Tree <Cell> row, bool isVolatile)
 {
     try {
         var methodCells = GetMethodCellRange(row, 1);
         try {
             Processor.Operate <CheckOperator>(
                 CellOperationValue.Make(
                     interpreter,
                     interpreter.MethodRowSelector.SelectMethodCells(methodCells),
                     interpreter.MethodRowSelector.SelectParameterCells(methodCells),
                     isVolatile),
                 row.Last());
         }
         catch (MemberMissingException e) {
             Processor.TestStatus.MarkException(row.Branches[1].Value, e);
         }
         catch (System.Exception e) {
             Processor.TestStatus.MarkException(row.Last().Value, e);
         }
     }
     catch (IgnoredException) {}
 }
Beispiel #8
0
        void CheckEventuallyMatches(CellOperationValue actualValue, Tree <Cell> expectedCell)
        {
            var wait = Processor.Memory.GetItem <Settings>().WaitTime;

            if (wait == 0)
            {
                wait = defaultWaitTime;
            }
            var        sleep  = 0;
            TypedValue actual = TypedValue.Void;

            for (var count = 0; count < 100; 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) / 100 - sleep;
                if (sleepThisTime <= 0)
                {
                    continue;
                }
                Thread.Sleep(sleepThisTime);
                sleep += sleepThisTime;
            }
            var actualCell = Processor.Compose(actual);

            Processor.TestStatus.MarkWrong(expectedCell.Value, actualCell.Value.Text);
        }
Beispiel #9
0
 public bool CanCheck(CellOperationValue actualValue, Tree <Cell> expectedCell)
 {
     return(true);
 }
Beispiel #10
0
 public bool CanCheck(CellOperationValue actualValue, Tree <Cell> expectedCell)
 {
     return(expectedCell.Value.Text.Length == 0 &&
            expectedCell.IsLeaf);
 }
Beispiel #11
0
 public bool CanCheck(CellOperationValue actualValue, Tree <Cell> expectedCell)
 {
     return(expectedCell.Value.Text.StartsWith(">>"));
 }