Exemplo n.º 1
0
        public void It_Should_Join_String_With_A_String()
        {
            // Arrange
                
            var filter = new JoinFilter(new StringValue(", "));

            // Act
            var result = filter.Apply(new TemplateContext(), new StringValue("Hello World")).SuccessValue<StringValue>();

            // Assert
            Assert.That(result.Value, Is.EqualTo("H, e, l, l, o,  , W, o, r, l, d"));

        }
Exemplo n.º 2
0
        public void It_Should_Join_An_Array_With_A_String()
        {
            // Arrange
            IList<IExpressionConstant> objlist = new List<IExpressionConstant>
            {
                new StringValue("a string"), 
                NumericValue.Create(123), 
                NumericValue.Create(456m),
                new BooleanValue(false)
            };
            ArrayValue arrayValue = new ArrayValue(objlist);
            var filter = new JoinFilter(new StringValue(", "));

            // Act
            var result = filter.Apply(new TemplateContext(), arrayValue).SuccessValue<StringValue>();
            //Logger.Log(result.ToString());

            // Assert
            Assert.That(result.StringVal, Is.EqualTo("a string, 123, 456.0, false"));
     
        }