public void Create_Returns_Instance_Which_Can_Be_Run() { ListErrors(() => { RazorCompiler compiler = new RazorCompiler(); var factory = compiler.CompileFactory<TestRazorTemplate<string>>("@Model"); var template = factory.Create(); Assert.AreEqual("<strong>Hello World!</strong>", template.Run("<strong>Hello World!</strong>")); }); }
public void Create_Returns_New_Instances_Each_Time() { ListErrors(() => { RazorCompiler compiler = new RazorCompiler(); var factory = compiler.CompileFactory<TestRazorTemplate<string>>("@Model"); var template1 = factory.Create(); var template2 = factory.Create(); Assert.AreNotSame(template1, template2); }); }