Example #1
0
 public void CheckOtherwiseRequired()
 {
     var tag = new Otherwise();
     RequiredAttribute.Check(tag);
 }
Example #2
0
 public void ChooseThreeTrueAndOtherWise()
 {
     var tag = new Choose();
     var whenTrue = new When();
     whenTrue.Body = new MockAttribute(new Constant("True1"));
     whenTrue.Select = new MockAttribute(new Constant("/results/value[position()=1]"));
     whenTrue.Source = new MockAttribute(new Constant("xml"));
     tag.AddNestedTag(whenTrue);
     var whenTrue2 = new When();
     whenTrue2.Body = new MockAttribute(new Constant("True2"));
     whenTrue2.Select = new MockAttribute(new Constant("/results/value[position()=1]"));
     whenTrue2.Source = new MockAttribute(new Constant("xml"));
     tag.AddNestedTag(whenTrue2);
     var whenTrue3 = new When();
     whenTrue3.Body = new MockAttribute(new Constant("True3"));
     whenTrue3.Select = new MockAttribute(new Constant("/results/value[position()=1]"));
     whenTrue3.Source = new MockAttribute(new Constant("xml"));
     tag.AddNestedTag(whenTrue2);
     var otherwise = new Otherwise();
     otherwise.Body = new MockAttribute(new Constant("Ötherwise"));
     tag.AddNestedTag(otherwise);
     Assert.That(tag.Evaluate(_model), Is.EqualTo("True1"));
 }
Example #3
0
 public void ChooseTwoFalseAndOtherWise()
 {
     var tag = new Choose();
     var whenFalse = new When();
     whenFalse.Body = new MockAttribute(new Constant("Body1"));
     whenFalse.Select = new MockAttribute(new Constant("/results/value[position()=2]"));
     whenFalse.Source = new MockAttribute(new Constant("xml"));
     tag.AddNestedTag(whenFalse);
     var whenFalse2 = new When();
     whenFalse2.Body = new MockAttribute(new Constant("Body2"));
     whenFalse2.Select = new MockAttribute(new Constant("/results/value[position()=2]"));
     whenFalse2.Source = new MockAttribute(new Constant("xml"));
     tag.AddNestedTag(whenFalse2);
     var otherwise = new Otherwise();
     otherwise.Body = new MockAttribute(new Constant("Body3"));
     tag.AddNestedTag(otherwise);
     Assert.That(tag.Evaluate(_model), Is.EqualTo("Body3"));
 }
Example #4
0
 public void ChooseOnlyOtherwise()
 {
     var tag = new Choose();
     var otherwise = new Otherwise();
     otherwise.Body = new MockAttribute(new Constant("Body1"));
     tag.AddNestedTag(otherwise);
     Assert.That(tag.Evaluate(_model), Is.EqualTo("Body1"));
 }