diff options
* Extracted common superclass for GetAssetStreamHandler and CachedGetAssetStreamHandler
* Added some more tests
Diffstat (limited to 'OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs')
-rw-r--r-- | OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs b/OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs new file mode 100644 index 0000000..aa97f62 --- /dev/null +++ b/OpenSim/Framework/Servers/Tests/CachedGetAssetStreamHandlerTests.cs | |||
@@ -0,0 +1,72 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using NUnit.Framework; | ||
5 | using OpenSim.Data; | ||
6 | using OpenSim.Framework.Servers.HttpServer; | ||
7 | using OpenSim.Tests.Common; | ||
8 | |||
9 | namespace OpenSim.Framework.Servers.Tests | ||
10 | { | ||
11 | [TestFixture] | ||
12 | public class CachedGetAssetStreamHandlerTests | ||
13 | { | ||
14 | private const string ASSETS_PATH = "/assets"; | ||
15 | |||
16 | [Test] | ||
17 | public void TestConstructor() | ||
18 | { | ||
19 | TestHelper.InMethod(); | ||
20 | |||
21 | CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(null); | ||
22 | } | ||
23 | |||
24 | [Test] | ||
25 | public void TestGetParams() | ||
26 | { | ||
27 | TestHelper.InMethod(); | ||
28 | |||
29 | CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(null); | ||
30 | BaseRequestHandlerTestHelper.BaseTestGetParams(handler, ASSETS_PATH); | ||
31 | } | ||
32 | |||
33 | [Test] | ||
34 | public void TestSplitParams() | ||
35 | { | ||
36 | TestHelper.InMethod(); | ||
37 | |||
38 | CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(null); | ||
39 | BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, ASSETS_PATH); | ||
40 | } | ||
41 | |||
42 | [Test] | ||
43 | public void TestHandleNoParams() | ||
44 | { | ||
45 | TestHelper.InMethod(); | ||
46 | |||
47 | CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(null); | ||
48 | |||
49 | BaseRequestHandlerTestHelper.BaseTestHandleNoParams(handler, ASSETS_PATH); | ||
50 | } | ||
51 | |||
52 | [Test] | ||
53 | public void TestHandleMalformedGuid() | ||
54 | { | ||
55 | TestHelper.InMethod(); | ||
56 | |||
57 | CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(null); | ||
58 | |||
59 | BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH); | ||
60 | } | ||
61 | |||
62 | //[Test] | ||
63 | //public void TestHandleFetchMissingAsset() | ||
64 | //{ | ||
65 | |||
66 | // byte[] emptyResult = new byte[] { }; | ||
67 | // CachedGetAssetStreamHandler handler = new CachedGetAssetStreamHandler(null); | ||
68 | |||
69 | // Assert.AreEqual(new string[] { }, handler.Handle("/assets/badGuid", null, null, null), "Failed on bad guid."); | ||
70 | //} | ||
71 | } | ||
72 | } | ||