Changed to use Authenticate asp.net event instead of Authorize
[castle.git] / MonoRail / Castle.MonoRail.Views.Brail.Tests / BrailSubViewTestCase.cs
blobbd99a3ce8d3fe223740a9073cd66f8b9cf9dfbef
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 namespace Castle.MonoRail.Views.Brail.Tests
16 using System.Text;
17 using Castle.MonoRail.Framework.Tests;
18 using NUnit.Framework;
20 [TestFixture]
21 public class BrailSubViewTestCase : AbstractTestCase
23 [Test]
24 public void BrailWillCacheSubViewsWhenUsingForwardSlash()
26 DoGet("subview/useLotsOfSubViews.rails");
27 StringBuilder sb = new StringBuilder();
28 for (int i = 0; i < 50; i++)
30 sb.Append("real");
32 string expected = sb.ToString();
33 AssertReplyEqualTo(expected);
35 // Here we tell the controller to replace the subview with a dummy implementation
36 // if brail doesn't cache it, it will use the real implementation, and the test will fail.
37 sb = new StringBuilder();
38 for (int i = 0; i < 50; i++)
40 sb.Append("dummy");
42 DoGet("subview/useLotsOfSubViews.rails", "replaceSubView=true");
43 expected = sb.ToString();
44 AssertReplyEqualTo(expected);
47 [Test]
48 public void CanCallSubViews()
50 DoGet("subview/index.rails");
51 string expected = "View With SubView Content\r\nFrom SubView";
52 AssertReplyEqualTo(expected);
55 [Test]
56 public void CanCallSubViewWithPath()
58 DoGet("subview/SubViewWithPath.rails");
59 string expected = "View With SubView Content\r\nContents for heyhello View";
60 AssertReplyEqualTo(expected);
63 [Test]
64 public void SubViewWithLayout()
66 DoGet("subview/SubViewWithLayout.rails");
67 string expected = "\r\nWelcome!\r\n<p>View With SubView Content\r\nFrom SubView</p>\r\nFooter";
68 AssertReplyEqualTo(expected);
71 [Test]
72 public void SubViewWithParameters()
74 DoGet("subview/SubViewWithParameters.rails");
75 string expected = "View SubView Content With Parameters\r\nMonth: 0\r\nAllow Select: False";
76 AssertReplyEqualTo(expected);