Beispiel #1
0
        public void LoadFromFile()
        {
            var definition = new TemplateOveridingDefinitionTile(
                "def",
                new FileTemplate("a.htm"),
                tile,
                new List <TileAttribute>()
                );

            Assert.That(definition.Name, Is.EqualTo("def"));
            Assert.That(definition.Render(model), Is.Not.Empty);
            Assert.That(definition.Render(model), Is.Not.EqualTo(tile.Render(model)));
        }
Beispiel #2
0
        public void RenderOfADefinitionWithOutAnyAttributesShouldRenderTheSameAsTheUnderlyingFileTile()
        {
            var definition = new TemplateOveridingDefinitionTile(
                "def",
                new FileTemplate("a.htm"),
                tile,
                new List <TileAttribute>()
                );

            Assert.That(definition.Name, Is.EqualTo("def"));
            Assert.That(definition.Render(model), Is.Not.Empty);
            Assert.That(definition.Render(model), Is.Not.EqualTo(tile.Render(model)));
        }
Beispiel #3
0
        public void DefinitionMergesExtendsAttributes()
        {
            var parent = new DefinitionTile(
                "main",
                tile,
                new List <TileAttribute>
            {
                new TileAttribute("second", new StringTile("1")),
                new TileAttribute("first", new StringTile("2"))
            }
                );
            var extends = new TemplateOveridingDefinitionTile(
                "def",
                new FileTemplate("a.htm"),
                parent,
                new List <TileAttribute> {
                new TileAttribute("first", new StringTile("A"))
            }
                );

            Assert.That(extends.Attributes.Count, Is.EqualTo(2));
            Assert.That(extends.Attributes["first"].Value.Render(null), Is.EqualTo("A"));
        }