public void Template_engine_performs_data_replacements() { var service = new BasicTemplateService(); var t = new Template { Content = @"This is a {foo}." }; var d = new TemplateData {{ "foo", "bar" }}; var w = service.Render(t.Content, d, null); Assert.That(w, Is.EqualTo(@"This is a bar.")); }
public void Template_engine_performs_url_replacements_with_virtual_directory() { var service = new BasicTemplateService(); var r = new MockRequest(new Uri("http://sandbox.ascendrewards.com/bar/admin/foo"), "/bar"); var t = new Template { Content = @"This is a <a href=""~/url"">link</a>." }; var d = new TemplateData {{ "foo", "bar" }}; var w = service.Render(t.Content, d, r); Assert.That(w, Is.EqualTo(@"This is a <a href=""http://sandbox.ascendrewards.com/bar/url"">link</a>.")); }