Exemplo n.º 1
0
        public void RenderOfADefinitionWithOutAnyAttributesShouldRenderTheSameAsTheUnderlyingFileTile()
        {
            var definition = new DefinitionTile(
                "def",
                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.EqualTo(tile.Render(model)));
        }
Exemplo n.º 2
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)));
        }
Exemplo n.º 3
0
 public void HandNestedIncludeWithParentDirs()
 {
     ITile a = new TemplateTile("a", _factory.Handle("Home/Index.htm",true), new List<TileAttribute>());
     var result = a.Render(new TagModel(new Dictionary<string, string> { { "Message", "Test" } }));
     string expected = File.ReadAllText("expected_insert_template.htm");
     result = CleanUp(result);
     expected = CleanUp(expected);
     Assert.That(result, Is.EqualTo(expected));
 }
Exemplo n.º 4
0
        public void HandNestedIncludeWithParentDirs()
        {
            ITile a      = new TemplateTile("a", _factory.Handle("Home/Index.htm", true), new List <TileAttribute>());
            var   result = a.Render(new TagModel(new Dictionary <string, string> {
                { "Message", "Test" }
            }));
            string expected = File.ReadAllText("expected_insert_template.htm");

            result   = CleanUp(result);
            expected = CleanUp(expected);
            Assert.That(result, Is.EqualTo(expected));
        }
Exemplo n.º 5
0
        public void HandNestedIncludeWithPrefixDirs()
        {
            var   template = new ResourceTemplate(_lib, new FileBasedResourceLocator("Views"), new FileLocatorFactory(), "Home/Index.htm");
            ITile a        = new TemplateTile("a", template, new List <TileAttribute>());
            var   result   = a.Render(new TagModel(new Dictionary <string, string> {
                { "Message", "Test" }
            }));
            string expected = File.ReadAllText("expected_insert_template.htm");

            result   = CleanUp(result);
            expected = CleanUp("VIEWS" + expected);
            Assert.That(result, Is.EqualTo(expected));
        }
Exemplo n.º 6
0
 public void HandNestedIncludeWithPrefixDirs()
 {
     var template = new ResourceTemplate(_lib,new FileBasedResourceLocator("Views"), new FileLocatorFactory(), "Home/Index.htm");
     ITile a = new TemplateTile("a", template, new List<TileAttribute>());
     var result = a.Render(new TagModel(new Dictionary<string, string> { { "Message", "Test" } }));
     string expected = File.ReadAllText("expected_insert_template.htm");
     result = CleanUp(result);
     expected = CleanUp("VIEWS" + expected);
     Assert.That(result, Is.EqualTo(expected));
 }