* Introduced new HttpServer.Tests project

* Split the GetAssetStreamHandler testing into separate tests for BaseRequestHandler
* Ignored some gens
This commit is contained in:
lbsa71
2009-05-08 06:11:44 +00:00
parent bf5fda8908
commit 8ac73be917
6 changed files with 136 additions and 37 deletions

View File

@@ -75,5 +75,12 @@ namespace OpenSim.Framework.Servers.HttpServer
return path.StartsWith(Path);
}
public string[] SplitParams(string path)
{
string param = GetParam(path);
return param.Split(new char[] { '/', '?', '&' }, StringSplitOptions.RemoveEmptyEntries);
}
}
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using OpenSim.Tests.Common;
namespace OpenSim.Framework.Servers.HttpServer.Tests
{
[TestFixture]
public class BaseRequestHandlerTests
{
private const string BASE_PATH = "/testpath";
private class BaseRequestHandlerImpl : BaseRequestHandler
{
public BaseRequestHandlerImpl(string httpMethod, string path) : base(httpMethod, path)
{
}
}
[Test]
public void TestConstructor()
{
BaseRequestHandlerImpl handler = new BaseRequestHandlerImpl( null, null );
}
[Test]
public void TestGetParams()
{
BaseRequestHandlerImpl handler = new BaseRequestHandlerImpl(null, BASE_PATH);
BaseRequestHandlerTestHelper.BaseTestGetParams(handler, BASE_PATH);
}
[Test]
public void TestSplitParams()
{
BaseRequestHandlerImpl handler = new BaseRequestHandlerImpl(null, BASE_PATH);
BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, BASE_PATH);
}
}
}