Beispiel #1
0
        public void PlusWithDecimalPointFromObject(string input, string argument, decimal expectedResult)
        {
            var inputA  = NumberValue.Create(input);
            var inputB  = new FilterArguments(NumberValue.Create(argument));
            var context = new TemplateContext();

            var result = NumberFilters.Plus(inputA, inputB, context);

            Assert.Equal(expectedResult, result.Result.ToNumberValue());
        }
Beispiel #2
0
        public void PlusConvertsObjectToNumber()
        {
            var input = new ObjectValue("6");

            var arguments = new FilterArguments(3);
            var context   = new TemplateContext();

            var result = NumberFilters.Plus(input, arguments, context);

            Assert.Equal(9, result.ToNumberValue());
        }
Beispiel #3
0
        public void Plus()
        {
            var input = NumberValue.Create(6);

            var arguments = new FilterArguments('3');
            var context   = new TemplateContext();

            var result = NumberFilters.Plus(input, arguments, context);

            Assert.Equal(9, result.ToNumberValue());
        }