52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
// /**
|
|
// * File: HtmlTests.cs
|
|
// * Author: haraldwolff
|
|
// *
|
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|
// *
|
|
// *
|
|
// **/
|
|
using NUnit.Framework;
|
|
using System;
|
|
using ln.templates.html;
|
|
using System.IO;
|
|
|
|
namespace ln.templates.test
|
|
{
|
|
[TestFixture()]
|
|
public class HtmlTests
|
|
{
|
|
|
|
[TestCase()]
|
|
public void Test_Base()
|
|
{
|
|
Template template = new Template("tests/test_base.html", null);
|
|
Console.WriteLine("Template Source:\n{0}", template.Document.ToString());
|
|
|
|
StringWriter targetWriter = new StringWriter();
|
|
template.Render(targetWriter);
|
|
|
|
Console.WriteLine("Rendered Document:\n{0}", targetWriter.ToString());
|
|
}
|
|
|
|
[TestCase()]
|
|
public void Test_Slots()
|
|
{
|
|
FileSystemTemplateSource templateSource = new FileSystemTemplateSource("tests");
|
|
Template template = templateSource.GetTemplateByPath("test_slots.html");
|
|
|
|
Console.WriteLine("Template Source:\n{0}", template.Document.ToString());
|
|
|
|
StringWriter targetWriter = new StringWriter();
|
|
template.Render(targetWriter);
|
|
|
|
using (StreamWriter sw = new StreamWriter("test.out.slots.html"))
|
|
sw.Write(targetWriter.ToString());
|
|
|
|
Console.WriteLine("Rendered Document:\n{0}", targetWriter.ToString());
|
|
}
|
|
|
|
}
|
|
}
|