Changed to use Authenticate asp.net event instead of Authorize
[castle.git] / MonoRail / Castle.MonoRail.Views.Brail.Tests / DslFixture.cs
blob2f473fb8c85b947e5ecc3407d2897c27d460c97e
1 namespace Castle.MonoRail.Views.Brail.Tests
3 using System.Configuration;
4 using System.IO;
5 using Controllers;
6 using NUnit.Framework;
7 using TestSupport;
9 [TestFixture]
10 public class DslFixture : BaseControllerTest
12 [Test]
13 public void CanOutputParagraphWithClassAttribute()
15 BooViewEngine bve = new BooViewEngine();
16 string viewPath = Path.Combine(ConfigurationManager.AppSettings["tests.src"], "Views");
17 bve.Service(new ViewSourceLoaderServiceProvider(viewPath));
18 bve.Initialize();
19 StringWriter sw = new StringWriter();
20 DslController controller = new DslController();
21 PrepareController(controller, "", "dsl", "attributeOutput");
22 bve.Process(sw, Context, controller, "dsl/attributeOutput");
23 Assert.AreEqual("<html><p class=\"foo\">hello world</p></html>", sw.ToString());
26 [Test]
27 public void ParametersCanBeReferencedByView()
29 BooViewEngine bve = new BooViewEngine();
30 string viewPath = Path.Combine(ConfigurationManager.AppSettings["tests.src"], "Views");
31 bve.Service(new ViewSourceLoaderServiceProvider(viewPath));
32 bve.Initialize();
33 StringWriter sw = new StringWriter();
34 DslController controller = new DslController();
35 controller.PropertyBag["SayHelloTo"] = "Harris";
36 PrepareController(controller, "", "dsl", "expandParameters");
37 bve.Process(sw, Context, controller, "dsl/expandParameters");
38 Assert.AreEqual("<html><p>hello, Harris</p></html>", sw.ToString());
41 [Test]
42 public void RegisterHtmlAllowsCallToHtml()
44 BooViewEngine bve = new BooViewEngine();
45 string viewPath = Path.Combine(ConfigurationManager.AppSettings["tests.src"], "Views");
46 bve.Service(new ViewSourceLoaderServiceProvider(viewPath));
47 bve.Initialize();
48 StringWriter sw = new StringWriter();
49 DslController controller = new DslController();
50 PrepareController(controller, "", "dsl", "registerHtml");
51 bve.Process(sw, Context, controller, "dsl/registerHtml");
52 Assert.AreEqual(@"<html>hello world</html>", sw.ToString());