From 54b5346f16ace21bad12c58500bbaa6e1739608e Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 8 May 2009 15:44:35 +0000 Subject: * Extracted common superclass for GetAssetStreamHandler and CachedGetAssetStreamHandler * Added some more tests --- OpenSim/Tests/Common/BaseRequestHandlerTestHelper.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Tests/Common/BaseRequestHandlerTestHelper.cs') diff --git a/OpenSim/Tests/Common/BaseRequestHandlerTestHelper.cs b/OpenSim/Tests/Common/BaseRequestHandlerTestHelper.cs index 4052920..7e91fde 100644 --- a/OpenSim/Tests/Common/BaseRequestHandlerTestHelper.cs +++ b/OpenSim/Tests/Common/BaseRequestHandlerTestHelper.cs @@ -40,5 +40,18 @@ namespace OpenSim.Tests.Common Assert.AreEqual(new string[] { "c", "d" }, handler.SplitParams(assetsPath + "/c/d"), "Failed on second segment."); Assert.AreEqual(new string[] { "e", "f" }, handler.SplitParams(assetsPath + "/e/f/"), "Failed on trailing slash."); } + + public static byte[] EmptyByteArray = new byte[] {}; + + public static void BaseTestHandleNoParams(BaseGetAssetStreamHandler handler, string assetsPath) + { + Assert.AreEqual(EmptyByteArray, handler.Handle(assetsPath, null, null, null), "Failed on empty params."); + Assert.AreEqual(EmptyByteArray, handler.Handle(assetsPath + "/", null, null, null), "Failed on single slash."); + } + + public static void BaseTestHandleMalformedGuid(BaseGetAssetStreamHandler handler, string assetsPath) + { + Assert.AreEqual(EmptyByteArray, handler.Handle(assetsPath + "/badGuid", null, null, null), "Failed on bad guid."); + } } } -- cgit v1.1