Example #1
0
        public void IsLogicalShouldReturnCorrectResult()
        {
            var func = new IsLogical();

            var args   = FunctionsHelper.CreateArgs(1);
            var result = func.Execute(args, _context);

            Assert.IsFalse((bool)result.Result);

            args   = FunctionsHelper.CreateArgs("true");
            result = func.Execute(args, _context);
            Assert.IsFalse((bool)result.Result);

            args   = FunctionsHelper.CreateArgs(false);
            result = func.Execute(args, _context);
            Assert.IsTrue((bool)result.Result);
        }
Example #2
0
        public void IsLogicalWithInvalidArgumentReturnsPoundValue()
        {
            var func           = new IsLogical();
            var parsingContext = ParsingContext.Create();
            var args           = FunctionsHelper.CreateArgs();
            var result         = func.Execute(args, parsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }