public void Setup() { fileSystem = MockRepository.GenerateStub <IFileSystem>(); razorCompiler = MockRepository.GenerateStub <IRazorCompiler>(); razorCompiler.Stub(x => x.Compile(null, null)).IgnoreArguments().Return(new CompiledRazorTemplate(null, null)); engine = new RazorViewRenderingEngine(fileSystem, razorCompiler); RazorEngineCompileSettings compilerSettings = new RazorEngineCompileSettings(); engine.Initialize(ViewsDir, compilerSettings); }
public void Setup() { IFileSystem fileSystem = new WindowsFileSystem(); IRazorCompiler razorCompiler = new InMemoryRazorCompiler(); engine = new RazorViewRenderingEngine(fileSystem, razorCompiler); RazorEngineCompileSettings razorEngineCompileSettings = new RazorEngineCompileSettings(); razorEngineCompileSettings.DefaultNamespace = "Syborg.Tests"; razorEngineCompileSettings.DefaultClassName = "SyborgTestRazorTemplate"; razorEngineCompileSettings.NamespaceImports.Add("System"); razorEngineCompileSettings.NamespaceImports.Add("System.Collections"); razorEngineCompileSettings.NamespaceImports.Add("System.Collections.Generic"); razorEngineCompileSettings.DefaultBaseClass = typeof(RazorTemplateBase).FullName; razorEngineCompileSettings.ReferenceAssemblies.Add(typeof(HtmlString).Assembly); razorEngineCompileSettings.DebugMode = DebugMode; engine.Initialize("Views", razorEngineCompileSettings); }