Example #1
0
        private void RunRow(Parse row)
        {
            Parse cell = row.Parts;

            //first set input params
            for (int col = 0; col < columnAccessors.Length; col++)
            {
                Accessor     accessor    = columnAccessors[col];
                ICellHandler cellHandler = CellOperation.GetHandler(this, cell, accessor.ParameterType);
                if (!isOutputColumn[col])
                {
                    cellHandler.HandleInput(this, cell, accessor);
                }
                cell = cell.More;
            }
            command.ExecuteNonQuery();
            cell = row.Parts;
            //next evaluate output params
            for (int col = 0; col < columnAccessors.Length; col++)
            {
                Accessor     accessor    = columnAccessors[col];
                ICellHandler cellHandler = CellOperation.GetHandler(this, cell, accessor.ParameterType);
                if (isOutputColumn[col])
                {
                    cellHandler.HandleCheck(this, cell, accessor);
                }
                cell = cell.More;
            }
        }
Example #2
0
        private void CheckRow(Parse row)
        {
            Parse cell = row.Parts;

            //first set input params
            foreach (DbParameterAccessor accessor in accessors)
            {
                ICellHandler cellHandler = CellOperation.GetHandler(this, cell, accessor.ParameterType);

                if (!accessor.IsBoundToCheckOperation)
                {
                    cellHandler.HandleInput(this, cell, accessor);
                }
                cell = cell.More;
            }
            if (expectException)
            {
                try
                {
                    command.ExecuteNonQuery();
                    Wrong(row);
                }
                catch (Exception e)
                {
                    row.Parts.Last.More = new Parse("td",
                                                    Gray(e.ToString()), null, null);
                    if (errorCode.HasValue)
                    {
                        if (this.dbEnvironment.GetExceptionCode(e) == errorCode)
                        {
                            Right(row);
                        }
                        else
                        {
                            Wrong(row);
                        }
                    }
                    else
                    {
                        Right(row);
                    }
                }
            }
            else
            {
                command.ExecuteNonQuery();
                //evaluate output params
                cell = row.Parts;
                foreach (DbParameterAccessor accessor in accessors)
                {
                    ICellHandler cellHandler = CellOperation.GetHandler(this, cell, accessor.ParameterType);
                    if (accessor.IsBoundToCheckOperation)
                    {
                        cellHandler.HandleCheck(this, cell, accessor);
                    }
                    cell = cell.More;
                }
            }
        }
Example #3
0
        private void RunRow(Parse row)
        {
            Parse cell = row.Parts;

            //first set input params
            foreach (DbParameterAccessor accessor in columnBindings)
            {
                ICellHandler cellHandler = CellOperation.GetHandler(this, cell, accessor.ParameterType);
                cellHandler.HandleInput(this, cell, accessor);
                cell = cell.More;
            }
            command.ExecuteNonQuery();
        }
Example #4
0
        private void CheckMatchingRow(Parse row, DataRow d)
        {
            SetTargetObject(d);

            Parse cell = row.Parts;

            foreach (Accessor accessor in accessors)
            {
                ICellHandler cellHandler = CellOperation.GetHandler(this, cell, accessor.ParameterType);

                cellHandler.HandleCheck(this, cell, accessor);
                cell = cell.More;
            }
        }
        public override void HandleCheck(Fixture fixture, Parse cell, Accessor accessor)
        {
            string       expected = cell.Text.Substring("fail[".Length, cell.Text.Length - ("fail[".Length + 1));
            Parse        newCell  = new Parse("td", expected, null, null);
            ICellHandler handler  = CellOperation.GetHandler(fixture, newCell, accessor.ParameterType);

            if (handler.HandleEvaluate(fixture, newCell, accessor))
            {
                fixture.Wrong(cell);
            }
            else
            {
                fixture.Right(cell);
            }
        }
Example #6
0
        private bool IsMatch(Parse row, DataRow d)
        {
            SetTargetObject(d);
            Parse cell = row.Parts;

            foreach (DataColumnAccessor accessor in accessors)
            {
                ICellHandler cellHandler = CellOperation.GetHandler(this, cell, accessor.ParameterType);
                if (accessor.IsUsedForMatching() &&
                    (!cellHandler.HandleEvaluate(this, cell, accessor)))
                {
                    return(false);
                }
                cell = cell.More;
            }
            return(true);
        }