public void Last_EmptyArray() { var input = new ArrayValue(new StringValue[0]); var arguments = new FilterArguments(); var context = new TemplateContext(); var result = ArrayFilters.Last(input, arguments, context); Assert.IsType <NilValue>(result); }
public void Last() { var input = new ArrayValue(new[] { new StringValue("a"), new StringValue("b"), new StringValue("c") }); var arguments = new FilterArguments(); var context = new TemplateContext(); var result = ArrayFilters.Last(input, arguments, context); Assert.Equal(new StringValue("c"), result); }