1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
18 using Castle
.MonoRail
.Views
.Brail
.TestSite
.Controllers
;
20 using NUnit
.Framework
;
23 public class LanguageFeatures
: BaseViewOnlyTestFixture
26 public void CanHandleDynamicProxyObjects()
28 ProxyGenerator generator
= new ProxyGenerator();
29 object o
= generator
.CreateClassProxy(typeof(HomeController
.SimpleProxy
), new StandardInterceptor());
32 o
.GetType().GetProperty("Text");
33 throw new InvalidOperationException("Should have gotten AmbiguousMatchException here");
38 PropertyBag
["src"] = o
;
40 string expected
= "<?xml version=\"1.0\" ?>\r\n" +
44 // should not raise ambigious match exception
45 ProcessView_StripRailsExtension("Home/withDynamicProxyObject.rails");
46 AssertReplyEqualTo(expected
);
50 public void NullableProperties()
52 Foo
[] fooArray1
= new Foo
[] { new Foo("Bar"), new Foo(null), new Foo("Baz") }
;
53 this.PropertyBag
.Add("List", fooArray1
);
55 string expected
= "<?xml version=\"1.0\" ?>\r\n" +
59 // should not raise null exception
60 ProcessView_StripRailsExtension("Home/nullableProperties.rails");
61 AssertReplyEqualTo(expected
);