Ejemplo n.º 1
0
        public void NoTemplates()
        {
            TemplateServices templateServices = TemplateUtilities.CreateTestTemplateServices();

            string rawHtml = "some content";
            Dictionary <string, Template> templates = new Dictionary <string, Template>();
            string actualHtml = null;
            Dictionary <string, string> actualValues = new Dictionary <string, string>();

            templateServices.InjectTemplateRecursive(rawHtml, templates, out actualHtml, ref actualValues);

            // Check result
            Assert.AreEqual(rawHtml, actualHtml);
            Assert.AreEqual(0, actualValues.Count);
        }
Ejemplo n.º 2
0
        public void SingleTemplate()
        {
            TemplateServices templateServices = TemplateUtilities.CreateTestTemplateServices();

            string rawHtml = "some <!-- INJECT_TEMPLATE templateId='template0' --> content";
            Dictionary <string, Template> templates = TemplateUtilities.CreateTestTemplates();
            string actualHtml = null;
            Dictionary <string, string> actualValues = new Dictionary <string, string>();

            templateServices.InjectTemplateRecursive(rawHtml, templates, out actualHtml, ref actualValues);

            // Check result
            string expectedHTML = "some template0 content text content";

            Assert.AreEqual(expectedHTML, actualHtml);
            Assert.AreEqual(0, actualValues.Count);
        }