Exemplo n.º 1
0
        public override void DoRow(Parse theRow)
        {
            if (theRow.Parts.More.Size != firstRowCells.Size)
            {
                TestStatus.MarkException(theRow.Parts, new RowWidthException(firstRowCells.Size));
                return;
            }
            Parse headerCell = firstRowCells;

            foreach (Parse expectedValueCell in new CellRange(theRow.Parts.More).Cells)
            {
                try {
                    CellOperation.Check(GetTargetObject(), combineMember,
                                        new CellTree(theRow.Parts, headerCell),
                                        expectedValueCell);
                }
                catch (IgnoredException) {
                    TestStatus.MarkIgnore(expectedValueCell);
                }
                catch (Exception e) {
                    TestStatus.MarkException(expectedValueCell, e);
                }
                headerCell = headerCell.More;
            }
        }
Exemplo n.º 2
0
 public void DoCheckOperation(Parse expectedValue, CellRange cells)
 {
     CellOperation.Check(GetTargetObject(),
                         new CellRange(MethodCells(cells)),
                         new CellRange(ParameterCells(cells)),
                         expectedValue);
 }
Exemplo n.º 3
0
 public void DoCheckOperation(Parse expectedValue, CellRange cells)
 {
     CellOperation.Check(GetTargetObject(),
                         MethodRowSelector.SelectMethodCells(cells),
                         MethodRowSelector.SelectParameterCells(cells),
                         expectedValue);
 }
Exemplo n.º 4
0
        public override void DoRow(Parse row)
        {
            string memberName = "!" + Processor.ParseTree <Cell, MemberName>(headerRow.Parts.Last);

            var   parameterList = new List <Tree <Cell> >();
            Parse nameCell      = headerRow.Parts;
            Parse valueCell     = row.Parts;

            for (int i = 0;
                 i < headerRow.Parts.Size - 1;
                 i++, nameCell = nameCell.More, valueCell = valueCell.More)
            {
                parameterList.Add(new CellTreeLeaf(new GracefulName(nameCell.Text).ToString()));
                parameterList.Add(valueCell);
            }
            var result = Processor.InvokeWithThrow(new TypedValue(SystemUnderTest), memberName,
                                                   new EnumeratedTree <Cell>(parameterList));

            CellOperation.Check(SystemUnderTest, result, row.Parts.Last);
        }
Exemplo n.º 5
0
        void EvaluateCellsInMatchingRow(Parse row, object match)
        {
            SetTargetObject(match);
            Parse cell = row.Parts;

            foreach (Parse headerCell in new CellRange(headerCells).Cells)
            {
                if (cell == null)
                {
                    cell = new Parse("td", Label("missing"), null, null);
                    TestStatus.MarkWrong(cell);
                    row.Parts.Last.More = cell;
                }
                else
                {
                    CheckCalled();
                    CellOperation.Check(GetTargetObject(), headerCell, cell);
                }
                cell = cell.More;
            }
        }
Exemplo n.º 6
0
        public override void DoRow(Parse theRow)
        {
            try {
                CheckRowSize(theRow.Parts);

                for (int j = 0; j < expectedCount; j++)
                {
                    var memberCells = new List <Parse> {
                        headerCells.At(j)
                    };
                    foreach (Parse cell in methodSuffixCells.Cells)
                    {
                        memberCells.Add(cell);
                    }

                    Parse expectedCell = theRow.Parts.At(myParameterCount + j + 1);

                    try {
                        CellOperation.Check(GetTargetObject(), new CellRange(memberCells),
                                            myValues.GetCells(new CellRange(theRow.Parts, myParameterCount).Cells),
                                            expectedCell);
                    }
                    catch (MemberMissingException e) {
                        TestStatus.MarkException(headerCells.At(j), e);
                        TestStatus.MarkIgnore(expectedCell);
                    }
                    catch (IgnoredException) {
                        TestStatus.MarkIgnore(expectedCell);
                    }
                    catch (Exception e) {
                        TestStatus.MarkException(expectedCell, e);
                    }
                }
            }
            catch (Exception e) {
                TestStatus.MarkException(theRow.Parts, e);
            }
        }
Exemplo n.º 7
0
 public void Do(Tree<Cell> cell)
 {
     operation.Check(targetProvider.GetTargetObject(), memberCell, cell);
 }
Exemplo n.º 8
0
 public static void Check(this CellOperation operation, object systemUnderTest, Tree <Cell> memberName, Tree <Cell> expectedCell)
 {
     operation.Check(systemUnderTest, memberName, new CellTree(), expectedCell);
 }
Exemplo n.º 9
0
 public virtual void Check()
 {
     CellOperation.Check(GetTarget(actor), cells.More, cells.More.More);
 }