Beispiel #1
0
        public void ShouldBeAbleToCompileDustDirectory()
        {
            DirectoryInfo          root             = new DirectoryInfo("c:\\temp\\{0}_"._Format(MethodBase.GetCurrentMethod().Name).RandomLetters(5));
            ContentResponder       content          = GetTestContentResponder(root);
            CommonTemplateRenderer templateRenderer = new CommonTemplateRenderer(content);
            TestMonkey             monkey           = new TestMonkey();

            templateRenderer.Render(monkey);
            AppContentResponder appResponder = new AppContentResponder(content, new AppConf("Test"));
            CommonDustRenderer  renderer     = new CommonDustRenderer(appResponder);

            Expect.IsTrue(!string.IsNullOrEmpty(renderer.CombinedCompiledTemplates));
            OutLine(renderer.CombinedCompiledTemplates);
        }
Beispiel #2
0
        public void ShouldBeAbleToRenderDustTemplateForType()
        {
            DirectoryInfo          root             = new DirectoryInfo("c:\\temp\\{0}_"._Format(MethodBase.GetCurrentMethod().Name).RandomLetters(5));
            ContentResponder       content          = GetTestContentResponder(root);
            DirectoryInfo          dustRoot         = new DirectoryInfo(Path.Combine(content.Root, "common", "views"));
            CommonTemplateRenderer templateRenderer = new CommonTemplateRenderer(content);
            TestMonkey             monkey           = new TestMonkey();

            Expect.IsFalse(File.Exists(Path.Combine(dustRoot.FullName, "TestMonkey.dust")), "Template was already there");

            // should render a template into the dustRoot folder
            templateRenderer.Render(monkey);

            Expect.IsTrue(File.Exists(Path.Combine(dustRoot.FullName, "TestMonkey.dust")), "Template was not written as expected");
        }