Support multiple service models for a component. WindsorServiceHostFactory will...
[castle.git] / MonoRail / Castle.MonoRail.Views.Brail.Tests / BrailBugsTestCase.cs
blob9c794785cd1dd16de269cd0368d2dc296f8931a0
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 ScriptWithNoTempatingCode()
34 ProcessView_StripRailsExtension("bugs/no_code.rails");
35 AssertReplyEqualTo(@"<html>
36 <body>test</body>
37 </html>
38 ");
42 [Test]
43 public void MR_294_CaptureForInSubViewDoesNotPropogateUpward()
45 ProcessView_StripRailsExtension("bugs/MR_294_CaptureForInSubViewDoesNotPropogateUpward.rails");
46 AssertReplyEqualTo("ayende");
49 [Test]
50 public void MR_371_OutputComponentInSectionTooManyTimes()
52 ViewComponentFactory.Inspect(typeof(BugsController).Assembly);
53 ProcessView_StripRailsExtension("bugs/mr_371.rails");
54 AssertReplyEqualTo("123ayende 0<br/>123ayende 1<br/>123ayende 2<br/>");
57 [Test]
58 public void MR_262_DynamicComponents()
60 ViewComponentFactory.Inspect(typeof(BugsController).Assembly);
61 PropertyBag["components"] = new string[]
63 "SimpleInlineViewComponent3",
64 "SimpleInlineViewComponent2"
66 ProcessView_StripRailsExtension("usingcomponents/DynamicComponents.rails");
67 AssertReplyEqualTo("default component view picked up automaticallyThis is a view used by a component");
70 [Test]
71 public void MR_285_ViewName_Is_Reserved_CompilerKeyword()
73 ProcessView_StripRailsExtension("bugs/add.rails");
74 AssertReplyContains("Success");
78 [Test]
79 public void MR_299_Inline_SubView()
81 ProcessView_StripRailsExtension("bugs/inlineSubView.rails");
82 AssertReplyContains("Success");
85 [Test]
86 public void MS_378_AccessingIndexers()
88 PropertyBag["Data"] = new Data();
89 ProcessView("bugs/mr_378");
92 public class Data
94 public string[] array = new string[] { "one", "two", "three" };
96 public string[] Items
98 get { return array; }