Example #1
0
        public void SubstituteShouldReturnAReplacedStringAccordingToParamsWhen()
        {
            var func   = new Substitute();
            var result = func.Execute(FunctionsHelper.CreateArgs("testar testar", "es", "xx"), _parsingContext);

            Assert.AreEqual("txxtar txxtar", result.Result);
        }
Example #2
0
        public void SubstituteShouldReplaceOnlySecondInstance()
        {
            var func   = new Substitute();
            var result = func.Execute(FunctionsHelper.CreateArgs("testar testar", "es", "xx", 2), _parsingContext);

            Assert.AreEqual("testar txxtar", result.Result);
        }
Example #3
0
        public void SubstituteWithInvalidArgumentReturnsPoundValue()
        {
            var func   = new Substitute();
            var args   = FunctionsHelper.CreateArgs();
            var result = func.Execute(args, this.ParsingContext);

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