public async void RunTemplateAsync_Generates_Text_For_Template_With_A_Model() { //Arrange var templateContent = "Hello @Model.Name"; var model = new SimpleModel () { Name = "World" }; var compilationService = GetCompilationService(); var templatingService = new RazorTemplating(compilationService); //Act var result = await templatingService.RunTemplateAsync(templateContent, model); //Assert Assert.Equal("Hello World", result.GeneratedText); Assert.Null(result.ProcessingException); }
public async void RunTemplateAsync_Generates_Text_For_Template_With_A_Model() { //Arrange var templateContent = "Hello @Model.Name"; var model = new SimpleModel() { Name = "World" }; var compilationService = GetCompilationService(); var templatingService = new RazorTemplating(compilationService); //Act var result = await templatingService.RunTemplateAsync(templateContent, model); //Assert Assert.Equal("Hello World", result.GeneratedText); Assert.Null(result.ProcessingException); }