From ff28ecee1b35ba24ec538d8ed018c764476c62b4 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 14 Aug 2009 20:07:13 +0100 Subject: [PATCH] Re-enable TestSaveIarV0_1() Implement more parts of TestAssetService --- .../Archiver/Tests/InventoryArchiverTests.cs | 2 +- OpenSim/Tests/Common/Mock/TestAssetService.cs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 9784fcfab5..c66678f316 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). /// - //[Test] + [Test] public void TestSaveIarV0_1() { TestHelper.InMethod(); diff --git a/OpenSim/Tests/Common/Mock/TestAssetService.cs b/OpenSim/Tests/Common/Mock/TestAssetService.cs index 5f1184bd96..81f123a1e5 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetService.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetService.cs @@ -45,7 +45,13 @@ namespace OpenSim.Tests.Common.Mock public AssetBase Get(string id) { - return Assets[ id ]; + AssetBase asset; + if (Assets.ContainsKey(id)) + asset = Assets[id]; + else + asset = null; + + return asset; } public AssetMetadata GetMetadata(string id) @@ -59,8 +65,10 @@ namespace OpenSim.Tests.Common.Mock } public bool Get(string id, object sender, AssetRetrieved handler) - { - throw new NotImplementedException(); + { + handler(id, sender, Get(id)); + + return true; } public string Store(AssetBase asset)