1 // Copyright 2004-2007 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
17 using System
.Collections
;
18 using NUnit
.Framework
;
21 public class JustViewFixture
: BaseViewOnlyTestFixture
24 public void CanRenderViewWithoutUsingFullMonoRailPipeline()
26 string outpot
= ProcessView("home/index");
27 Assert
.AreEqual("Brail is wonderful", outpot
);
31 public void UsingExtentionMethods()
33 IDictionary dictionary
= new Hashtable();
34 dictionary
["items"] = new int[] {};
35 string templatePath
= "home/extensionMethods";
37 string actual
= ProcessView(dictionary
, templatePath
);
38 Assert
.AreEqual("No Data", actual
);
43 public void WithParameters()
45 IDictionary dictionary
= new Hashtable();
46 dictionary
["list"] = new int[] {2, 5, 7, 8}
;
47 dictionary
["name"] = "test";
48 string templatePath
= "home/bag";
50 string actual
= ProcessView(dictionary
, templatePath
);
51 string expected
= @"test is the name
57 Assert
.AreEqual(expected
, actual
);