Minor changes to improve testability of helpers
[castle.git] / MonoRail / Castle.MonoRail.Framework.Tests / ServerUtilityTestCase.cs
blobd3b976002d72051fbd917d4051a348425dddd899
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;
19 using Castle.MonoRail.TestSupport;
21 using NUnit.Framework;
24 [TestFixture]
25 public class ServerUtilityTestCase : AbstractTestCase
27 [Test]
28 public void UrlEncode()
30 DoGet("ServerUtility/UrlEncode.rails", "content=this is a path");
32 AssertReplyEqualTo("this+is+a+path");
35 [Test]
36 public void UrlDecode()
38 DoGet("ServerUtility/UrlDecode.rails", "content=this+is+a+path");
40 AssertReplyEqualTo("this is a path");
43 [Test]
44 public void HtmlEncode()
46 DoGet("ServerUtility/HtmlEncode.rails", "content=<html>content</html>");
48 AssertReplyEqualTo("&lt;html&gt;content&lt;/html&gt;");
51 [Test]
52 public void UrlPathEncode()
54 DoGet("ServerUtility/UrlPathEncode.rails", @"content=My path folder is this one");
56 AssertReplyEqualTo(@"My%20path%20folder%20is%20this%20one");
59 [Test]
60 public void JavaScriptEscape()
62 DoGet("ServerUtility/JavaScriptEscape.rails", "content=some js \" content \", test's");
64 AssertReplyEqualTo("some js \\\" content \\\", test\\'s");