Beispiel #1
0
        public void IsEvenShouldPoundValueOnNonNumericInput()
        {
            var args   = FunctionsHelper.CreateArgs("Not odd");
            var func   = new IsEven();
            var result = func.Execute(args, _context);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Beispiel #2
0
        public void IsEvenShouldReturnCorrectResult()
        {
            var args   = FunctionsHelper.CreateArgs(4.123);
            var func   = new IsEven();
            var result = func.Execute(args, _context);

            Assert.IsTrue((bool)result.Result);
        }
Beispiel #3
0
        public void IsEvenWithInvalidArgumentReturnsPoundValue()
        {
            var func           = new IsEven();
            var parsingContext = ParsingContext.Create();
            var args           = FunctionsHelper.CreateArgs();
            var result         = func.Execute(args, parsingContext);

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