diff options
Diffstat (limited to 'OpenSim/Framework/Servers/Tests')
-rw-r--r-- | OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs b/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs new file mode 100644 index 0000000..d399274 --- /dev/null +++ b/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs | |||
@@ -0,0 +1,42 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using NUnit.Framework; | ||
5 | |||
6 | namespace OpenSim.Framework.Servers.Tests | ||
7 | { | ||
8 | [TestFixture] | ||
9 | public class GetAssetStreamHandlerTests | ||
10 | { | ||
11 | [Test] | ||
12 | public void TestConstructor() | ||
13 | { | ||
14 | GetAssetStreamHandler handler = new GetAssetStreamHandler( null ); | ||
15 | } | ||
16 | |||
17 | [Test] | ||
18 | public void TestGetParams() | ||
19 | { | ||
20 | GetAssetStreamHandler handler = new GetAssetStreamHandler(null); | ||
21 | |||
22 | Assert.AreEqual("", handler.GetParam("/assets")); | ||
23 | Assert.AreEqual("/", handler.GetParam("/assets/")); | ||
24 | Assert.AreEqual("/a", handler.GetParam("/assets/a")); | ||
25 | Assert.AreEqual("/b/", handler.GetParam("/assets/b/")); | ||
26 | Assert.AreEqual("/c/d", handler.GetParam("/assets/c/d")); | ||
27 | Assert.AreEqual("/e/f/", handler.GetParam("/assets/e/f/")); | ||
28 | } | ||
29 | |||
30 | [Test] | ||
31 | public void TestSplitParams() | ||
32 | { | ||
33 | GetAssetStreamHandler handler = new GetAssetStreamHandler(null); | ||
34 | |||
35 | Assert.AreEqual(new string[] { }, handler.SplitParams("/assets"), "Failed on empty params."); | ||
36 | Assert.AreEqual(new string[] { }, handler.SplitParams("/assets/"), "Failed on single slash."); | ||
37 | Assert.AreEqual(new string[] { "a" }, handler.SplitParams("/assets/a"), "Failed on first segment."); | ||
38 | Assert.AreEqual(new string[] { "b" }, handler.SplitParams("/assets/b/"), "Failed on second slash."); | ||
39 | } | ||
40 | |||
41 | } | ||
42 | } | ||