Esempio n. 1
0
 public void LoopWithStepAndSimpleBody()
 {
     var tag = new ForTokens();
     tag.Items = new MockAttribute(new Property("AList"));
     tag.Delims = new MockAttribute(new Property("Delimeter"));
     tag.Body = new MockAttribute(new Property("Body"));
     tag.Step = new MockAttribute(new Constant("2"));
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo(Body + Body + Body + Body));
 }
Esempio n. 2
0
 public void LoopWithMultiDelimiterStringButSingleDelimterDelimiter()
 {
     var tag = new ForTokens();
     tag.Items = new MockAttribute(new Constant("1,2.3,4.5,6.7"));
     tag.Delims = new MockAttribute(new Property("Delimeter"));
     tag.Body = new TemplateAttribute(new Formatter(ComplexBody).Parse().ParsedTemplate);
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo("[1][2.3][4.5][6.7]"));
 }
Esempio n. 3
0
 public void LoopWithMultiDelimiterStringAndMultiDelimiter()
 {
     var tag = new ForTokens();
     tag.Items = new MockAttribute(new Constant("1,2.3,4.5,6.7"));
     tag.Delims = new MockAttribute(new Constant(",."));
     tag.Body = new TemplateAttribute(new Formatter(ComplexBody).Parse().ParsedTemplate);
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo("[1][2][3][4][5][6][7]"));
 }
Esempio n. 4
0
 public void LoopWithFirstEndAndStepComplexBody()
 {
     var tag = new ForTokens();
     tag.Items = new MockAttribute(new Property("AList"));
     tag.Delims = new MockAttribute(new Property("Delimeter"));
     tag.Begin = new MockAttribute(new Constant("1"));
     tag.End = new MockAttribute(new Constant("6"));
     tag.Step = new MockAttribute(new Constant("2"));
     tag.Body = new TemplateAttribute(new Formatter(ComplexBody).Parse().ParsedTemplate);
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo("[2][4][6]"));
 }
Esempio n. 5
0
 public void LoopWithComplexStatusBody()
 {
     var tag = new ForTokens();
     tag.Items = new MockAttribute(new Property("AList"));
     tag.Delims = new MockAttribute(new Property("Delimeter"));
     tag.Body = new TemplateAttribute(new Formatter(ComplexStatusBody).Parse().ParsedTemplate);
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo("[0/7][1/7][2/7][3/7][4/7][5/7][6/7]"));
 }
Esempio n. 6
0
 public void LoopNoBody()
 {
     var tag = new ForTokens();
     tag.Items = new MockAttribute(new Property("AList"));
     tag.Delims = new MockAttribute(new Property("Delimeter"));
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo(String.Empty));
 }