示例#1
0
        internal static IRule TestRule(Type ruleType, string cellValue, int cellIndex, IEnumerable<object> operands)
        {
            switch (cellIndex)
            {
                case 0:
                    FakeIngest.Reload(cellValue);
                    break;
                case 1:
                    FakeIngest.Reload(FakeIngest.FirstCellValue, cellValue);
                    break;
                case 2:
                    FakeIngest.Reload(FakeIngest.FirstCellValue, FakeIngest.SecondCellValue, cellValue);
                    break;
                case 3:
                    FakeIngest.Reload(FakeIngest.FirstCellValue, FakeIngest.SecondCellValue, FakeIngest.ThirdCellValue, cellValue);
                    break;
                default:
                    throw new InvalidOperationException("Invalid cell index specified");
            }

            Accessor.Record = FakeIngest.GetRecord();
            var cellOperand = new CellOperand(Accessor, cellIndex);
            return TestRule(ruleType, new List<IOperand> { cellOperand }, operands);
        }
示例#2
0
 public void CellOperandCannotGetValueWithNoCurrentRecord()
 {
     IOperand testOperand = new CellOperand(new RecordAccessor(), 0);
     Assert.Throws<InvalidOperationException>(delegate { testOperand.TextValue(); });
 }