aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Tests/Asset/AssetServerGetHandlerTests.cs
blob: d79192e9b569a3380057ac2886230457cc63f76c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
using NUnit.Framework;
using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Handlers.Asset;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;

namespace OpenSim.Server.Handlers.Tests.Asset
{
    [TestFixture]
    public class AssetServerGetHandlerTests
    {
        private const string ASSETS_PATH = "/assets";

        [Test]
        public void TestConstructor()
        {
            TestHelper.InMethod();

            AssetServerGetHandler handler = new  AssetServerGetHandler( null );
        }

        [Test]
        public void TestGetParams()
        {
            TestHelper.InMethod();

            AssetServerGetHandler handler = new  AssetServerGetHandler(null);
            BaseRequestHandlerTestHelper.BaseTestGetParams(handler, ASSETS_PATH);
        }

        [Test]
        public void TestSplitParams()
        {
            TestHelper.InMethod();

            AssetServerGetHandler handler = new  AssetServerGetHandler(null);
            BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, ASSETS_PATH);
        }

        //[Test]
        //public void TestHandleNoParams()
        //{
        //    TestHelper.InMethod();

        //    AssetServerGetHandler handler = new AssetServerGetHandler(null);

        //    BaseRequestHandlerTestHelper.BaseTestHandleNoParams(handler, ASSETS_PATH);
        //}

        //[Test]
        //public void TestHandleMalformedGuid()
        //{
        //    TestHelper.InMethod();

        //    AssetServerGetHandler handler = new AssetServerGetHandler(null);

        //    BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH);
        //}

        //[Test]
        //public void TestHandleFetchMissingAsset()
        //{
        //    IAssetService assetDataPlugin = new TestAssetDataPlugin();
        //    AssetServerGetHandler handler = new AssetServerGetHandler(assetDataPlugin);

        //    GetAssetStreamHandlerTestHelpers.BaseFetchMissingAsset(handler);
        //}

        //[Test]
        //public void TestHandleFetchExistingAssetData()
        //{
        //    AssetServerGetHandler handler;
        //    OSHttpResponse response;
        //    AssetBase asset = CreateTestEnvironment(out handler, out response);

        //    GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetDataTest(asset, handler, response);
        //}

        //[Test]
        //public void TestHandleFetchExistingAssetXml()
        //{
        //    AssetServerGetHandler handler;
        //    OSHttpResponse response;
        //    AssetBase asset = CreateTestEnvironment(out handler, out response);

        //    GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetXmlTest(asset, handler, response);
        //}

        private static AssetBase CreateTestEnvironment(out  AssetServerGetHandler handler, out OSHttpResponse response)
        {
            AssetBase asset = GetAssetStreamHandlerTestHelpers.CreateCommonTestResources(out response);

            IAssetService assetDataPlugin = new TestAssetService();
            handler = new  AssetServerGetHandler(assetDataPlugin);

            assetDataPlugin.Store(asset);
            return asset;
        }
    }
}