public void CanReadTemplateCompilerFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.AreEqual("CSharp3", section.TemplateCompiler); }
public void CanReadViewsNamespacesSectionFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.AreEqual(1, section.Namespaces.Count); Assert.AreEqual("System.Collections", section.Namespaces[0].Name); }
public void CanReadViewsAssembliesSectionFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.AreEqual(1, section.Assemblies.Count); Assert.AreEqual("System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089", section.Assemblies[0].Name); }
public void CanReadEscapeHtmlFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.IsTrue(section.EncodeHtml.HasValue); Assert.IsFalse(section.EncodeHtml.Value); }
public void CanReadOutputDebugFilesSettingFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.IsTrue(section.OutputDebugFiles.HasValue); Assert.AreEqual(true, section.OutputDebugFiles.Value); }
public void CanReadIndentSizeSettingFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.IsTrue(section.IndentSize.HasValue); Assert.AreEqual(2, section.IndentSize.Value); }
public void CanReadUseTabsSettingFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.IsTrue(section.UseTabs.HasValue); Assert.IsFalse(section.UseTabs.Value); }
public void CanReadAutoRecompileSettingFromAppSettings() { var section = NHamlConfigurationSection.GetSection(); Assert.IsNotNull(section); Assert.IsTrue(section.AutoRecompile.HasValue); Assert.IsTrue(section.AutoRecompile.Value); }
public TemplateEngine(TemplateOptions options) { Invariant.ArgumentNotNull(options, "options"); Options = options; _compiledTemplateCache = new Dictionary <string, CompiledTemplate>(); NHamlConfigurationSection.UpdateTemplateOptions(Options); Options.TemplateBaseTypeChanged += (sender, args) => ClearCompiledTemplatesCache(); Options.TemplateCompilerChanged += (sender, args) => ClearCompiledTemplatesCache(); }
public void GetConfiguration_ConfigWithReferencesAndImports_ImportListContainsCorrectElement() { var config = NHamlConfigurationSection.GetConfiguration("Configuration/configWithReferencesAndImports.config"); Assert.That(config.ImportsList.First(), Is.EqualTo("NHaml.Tests.Configuration, NHaml.Tests")); }
public void GetConfiguration_ConfigWithReferencesAndImports_ReferencedAssemblyListContainsCorrectElement() { var config = NHamlConfigurationSection.GetConfiguration("Configuration/configWithReferencesAndImports.config"); Assert.That(config.ReferencedAssembliesList.First().ToLower(), Is.StringEnding("nhaml.tests.dll")); }
public void GetConfiguration_EmptyFileName_ThrowsFileNotFoundException() { Assert.Throws <FileNotFoundException>(() => NHamlConfigurationSection.GetConfiguration("")); }