public void When_passing_code_Should_Execute_It_and_return_text() { ILocalizationService localizationService = new ResourceLocalizationService(); IViewExecutor ironRubyViewExecutor = new IronRubyViewExecutor(); var parser = new IronRubyViewParser(); var code = parser.Parse(_templatePath); var model = new {ftuValue = "100 USD",ftuUrl="LaunchPage",idModifier = "modifier"}; ironRubyViewExecutor.SetGlobalVariables("localization",localizationService); ironRubyViewExecutor.SetGlobalVariables("lang","en"); var html = ironRubyViewExecutor.Execute(RubyCode, model); Assert.That(html, Is.EqualTo(HtmlCode)); }
public void When_passing_code_Should_Execute_It_and_return_text() { IViewExecutor ironRubyViewExecutor = new IronRubyViewExecutor(); var parser = new IronRubyViewParser(); var code = parser.Parse(_templatePath); var model = new DynamicModel(); model.SetAttributeValue("ftuValue","100 USD"); model.SetAttributeValue("ftuUrl", "LaunchPage"); model.SetAttributeValue("idModifier", "modifier"); model.SetAttributeValue("phrases", new {FREE = "FREE", viewing_credit = "Viewing Credit", new_users = "new users", no_purchase_required = "no purchase required", start_here = "start here" }); var html = ironRubyViewExecutor.Execute(code, model); Assert.That(html, Is.EqualTo(HtmlCode)); }