Ejemplo n.º 1
0
 public void InsertShouldHandleDefitionWithAtributesTile()
 {
     var tag = new Insert
                   {
                       Name = new MockAttribute(new Constant("fileWithTilesAttributes"))
                   };
     Assert.That(tag.Evaluate(_model), Is.EqualTo("aAttributeValue"));
 }
Ejemplo n.º 2
0
 public void CheckWhenRequired()
 {
     var tag = new Insert();
     try
     {
         RequiredAttribute.Check(tag);
         Assert.Fail("Expected exception");
     }
     catch (TagException Te)
     {
         Assert.That(Te.Message,
                     Is.EqualTo(TagException.MissingRequiredAttribute(typeof(Insert), "Name").Message));
     }
     tag.Name = new MockAttribute(new Property("tiles"));
     RequiredAttribute.Check(tag);
 }
Ejemplo n.º 3
0
 public void InsertShouldHandleSimpleFileTile()
 {
     var tag = new Insert
                   {
                       Name = new MockAttribute(new Constant("file"))
                   };
     Assert.That(tag.Evaluate(_model), Is.EqualTo("aa"));
 }
Ejemplo n.º 4
0
 public void InsertShouldHandleFileWithVarsTile()
 {
     var tag = new Insert
                   {
                       Name = new MockAttribute(new Constant("fileWithVars"))
                   };
     Assert.That(tag.Evaluate(_model), Is.EqualTo("bbAAbb"));
 }
Ejemplo n.º 5
0
 public void OnNonExistingAttributgesTagShouldThrowException()
 {
     var tag = new Insert
                   {
                       Name = new MockAttribute(new Constant("nonexisting"))
                   };
     try
     {
         tag.Evaluate(_model);
         Assert.Fail("Expect exception");
     }
     catch (TileExceptionWithContext Te)
     {
         Assert.That(Te.Message, Is.EqualTo(TileException.AttributeNotFound("nonexisting", "main").Message));
     }
 }
Ejemplo n.º 6
0
 public void InsertShouldHandleSimpleStringTileDefinedByProperty()
 {
     var tag = new Insert
                   {
                       Name = new MockAttribute(new Property("simpleAsProperty"))
                   };
     Assert.That(tag.Evaluate(_model), Is.EqualTo("simpleValue"));
 }