Ejemplo n.º 1
0
        public static void TestFunkyEscapeSequenceInServerRender()
        {
            DustTemplate dc = new DustTemplate(@"Hello {Name}!
this is another line
and another", "test");

            dc.Compile();

            object value  = new { Name = "Guy" };
            string result = Dust.RenderMvcHtmlString("test", value).ToString();

            OutLine(result, ConsoleColor.Yellow);
        }
Ejemplo n.º 2
0
        public static void ShouldRenderDustUsingStatic()
        {
            DustTemplate dc = new DustTemplate("Hello {Name}!", "test");

            dc.Compile();
            object        value  = new { Name = "Guy" };
            MvcHtmlString result = Dust.RenderMvcHtmlString("test", value);

            Expect.AreEqual("Hello Guy!", result.ToHtmlString());
            OutLine();
            OutLine(result.ToString(), ConsoleColor.Yellow);
            value  = new { Name = "Dude" };
            result = Dust.RenderMvcHtmlString("test", value);
            Expect.AreEqual("Hello Dude!", result.ToHtmlString());
            OutLine(result.ToString(), ConsoleColor.Yellow);
        }