* Fix unit tests so that they correctly handle 404 missing asset response

* I didn't think there were tests in this area - my bad
This commit is contained in:
Justin Clarke Casey
2009-06-05 17:03:44 +00:00
parent 593942b195
commit 87097f2484
3 changed files with 14 additions and 9 deletions

View File

@@ -80,8 +80,7 @@ namespace OpenSim.Tests.Common.Setup
public static void BaseFetchExistingAssetMetaDataTest(AssetBase asset, BaseGetAssetStreamHandler handler, OSHttpResponse response)
{
XmlSerializer xs =
new XmlSerializer(typeof(AssetMetadata));
XmlSerializer xs = new XmlSerializer(typeof(AssetMetadata));
byte[] expected = ServerUtils.SerializeResult(xs, asset.Metadata);
@@ -112,9 +111,12 @@ namespace OpenSim.Tests.Common.Setup
return asset;
}
public static void BaseFetchMissingAsset(BaseGetAssetStreamHandler handler)
public static void BaseFetchMissingAsset(BaseGetAssetStreamHandler handler, OSHttpResponse response)
{
Assert.AreEqual(BaseRequestHandlerTestHelper.EmptyByteArray, handler.Handle("/assets/" + Guid.NewGuid(), null, null, null), "Failed on bad guid.");
Assert.AreEqual(
BaseRequestHandlerTestHelper.EmptyByteArray,
handler.Handle("/assets/" + Guid.NewGuid(), null, null, response), "Failed on bad guid.");
Assert.AreEqual((int)HttpStatusCode.NotFound, response.StatusCode, "Response code wrong in BaseFetchMissingAsset");
}
}
}