Fixing MR-378
[castle.git] / MonoRail / Castle.MonoRail.Views.Brail.Tests / BrailBugsTestCase.cs
blobffd4de46be6198767e0477370a6c3354d8f913a7
1 // Copyright 2004-2008 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.
15 namespace Castle.MonoRail.Views.Brail.Tests
17 using Castle.MonoRail.Views.Brail.TestSite.Controllers;
18 using NUnit.Framework;
20 [TestFixture]
21 public class BrailBugsTestCase : BaseViewOnlyTestFixture
23 [Test]
24 public void MR_233_TagInDoubleQuotes()
26 PropertyBag["page_id"] = 123;
27 ProcessView_StripRailsExtension("bugs/mr_233.rails");
28 AssertReplyEqualTo("<body id=\"123\">");
31 [Test]
32 public void MR_294_CaptureForInSubViewDoesNotPropogateUpward()
34 ProcessView_StripRailsExtension("bugs/MR_294_CaptureForInSubViewDoesNotPropogateUpward.rails");
35 AssertReplyEqualTo("ayende");
38 [Test]
39 public void MR_371_OutputComponentInSectionTooManyTimes()
41 ViewComponentFactory.Inspect(typeof(BugsController).Assembly);
42 ProcessView_StripRailsExtension("bugs/mr_371.rails");
43 AssertReplyEqualTo("123ayende 0<br/>123ayende 1<br/>123ayende 2<br/>");
46 [Test]
47 public void MR_262_DynamicComponents()
49 ViewComponentFactory.Inspect(typeof(BugsController).Assembly);
50 PropertyBag["components"] = new string[]
52 "SimpleInlineViewComponent3",
53 "SimpleInlineViewComponent2"
55 ProcessView_StripRailsExtension("usingcomponents/DynamicComponents.rails");
56 AssertReplyEqualTo("default component view picked up automaticallyThis is a view used by a component");
59 [Test]
60 public void MR_285_ViewName_Is_Reserved_CompilerKeyword()
62 ProcessView_StripRailsExtension("bugs/add.rails");
63 AssertReplyContains("Success");
67 [Test]
68 public void MR_299_Inline_SubView()
70 ProcessView_StripRailsExtension("bugs/inlineSubView.rails");
71 AssertReplyContains("Success");
74 [Test]
75 public void MS_378_AccessingIndexers()
77 PropertyBag["Data"] = new Data();
78 ProcessView("bugs/mr_378");
81 public class Data
83 public string[] array = new string[] { "one", "two", "three" };
85 public string[] Items
87 get { return array; }