Minor style changes
[castle.git] / MonoRail / Castle.MonoRail.Framework.Tests / LocalizationTestCase.cs
blob1203da939e1654318e91e40f967bfef164c1e39c
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.
15 namespace Castle.MonoRail.Framework.Tests
17 using System;
18 using System.Globalization;
20 using NUnit.Framework;
22 using Castle.MonoRail.TestSupport;
25 [TestFixture]
26 public class LocalizationTestCase : AbstractTestCase
28 private CultureInfo en = CultureInfo.CreateSpecificCulture( "en" );
29 private CultureInfo nl = CultureInfo.CreateSpecificCulture( "nl" );
30 private CultureInfo fr = CultureInfo.CreateSpecificCulture( "fr" );
32 [Test]
33 public void GetResource()
35 DoGet("resource/GetResource.rails");
37 AssertSuccess();
39 AssertReplyEqualTo("english");
42 [Test]
43 public void GetResourceByCulture()
45 DoGet("resource/GetResourceByCulture.rails");
47 AssertSuccess();
49 AssertReplyEqualTo("deutsch");
52 [Test]
53 public void SetLocaleCulture()
55 DoGet("resource/GetResource.rails", "locale=nl");
57 AssertSuccess();
59 AssertReplyEqualTo("nederlands");
62 [Test]
63 public void GetFallbackResource()
65 DoGet("resource/GetResource.rails", "locale=fr");
67 AssertSuccess();
69 AssertReplyEqualTo("english");