Beispiel #1
0
        private void ValidateOffsetAndOffsetAddress(IEnumerable <FunctionArgument> arguments, ParsingContext context, object expectedOffsetResult, object expectedOffsetAddressResult, bool errorExpected = false)
        {
            Offset        offsetFunction        = new Offset();
            OffsetAddress offsetAddressFunction = new OffsetAddress();
            var           offsetResult          = offsetFunction.Execute(arguments, context);
            var           offsetAddressResult   = offsetAddressFunction.Execute(arguments, context);

            if (errorExpected)
            {
                Assert.AreEqual(expectedOffsetResult, ((ExcelErrorValue)offsetResult.Result).Type);
                Assert.AreEqual(expectedOffsetAddressResult, ((ExcelErrorValue)offsetAddressResult.Result).Type);
            }
            else
            {
                Assert.AreEqual(expectedOffsetResult, offsetResult);
                Assert.AreEqual(expectedOffsetAddressResult, offsetAddressResult);
            }
        }