コード例 #1
0
        public void Ensure_KeyCompile_Resolved_And_Compiles_Template()
        {
            var templateManager = new Mock <ITemplateManager>();

            templateManager.Setup(t => t.Resolve(It.IsAny <string>())).Returns(new LoadedTemplateSource("Hello @Model.Title"));

            IEngineCore       core   = new EngineCore(templateManager.Object);
            CompilationResult result = core.KeyCompile("whatever");

            Assert.NotNull(result);
            Assert.Null(result.CompilationFailures);
            Assert.NotNull(result.CompiledType);
        }