diff options
author | lbsa71 | 2009-05-13 17:11:53 +0000 |
---|---|---|
committer | lbsa71 | 2009-05-13 17:11:53 +0000 |
commit | 40e95cab02b125a6c9ec7e90cab94c94b201f021 (patch) | |
tree | 6c77dce02a24ee061cf936f95faca13b41759fbe /OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | |
parent | Disabling WebFetchInventoryDescendents CAPs for the time being as it (diff) | |
download | opensim-SC_OLD-40e95cab02b125a6c9ec7e90cab94c94b201f021.zip opensim-SC_OLD-40e95cab02b125a6c9ec7e90cab94c94b201f021.tar.gz opensim-SC_OLD-40e95cab02b125a6c9ec7e90cab94c94b201f021.tar.bz2 opensim-SC_OLD-40e95cab02b125a6c9ec7e90cab94c94b201f021.tar.xz |
* Added some more tests to the GetAssetStreamHandlers
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs new file mode 100644 index 0000000..acfe4fe --- /dev/null +++ b/OpenSim/Tests/Common/Mock/BaseAssetRepository.cs | |||
@@ -0,0 +1,34 @@ | |||
1 | using System.Collections.Generic; | ||
2 | using OpenMetaverse; | ||
3 | using OpenSim.Framework; | ||
4 | |||
5 | namespace OpenSim.Tests.Common.Mock | ||
6 | { | ||
7 | public class BaseAssetRepository | ||
8 | { | ||
9 | protected Dictionary<UUID, AssetBase> Assets = new Dictionary<UUID, AssetBase>(); | ||
10 | |||
11 | public AssetBase FetchAsset(UUID uuid) | ||
12 | { | ||
13 | if (ExistsAsset(uuid)) | ||
14 | return Assets[uuid]; | ||
15 | else | ||
16 | return null; | ||
17 | } | ||
18 | |||
19 | public void CreateAsset(AssetBase asset) | ||
20 | { | ||
21 | Assets[asset.FullID] = asset; | ||
22 | } | ||
23 | |||
24 | public void UpdateAsset(AssetBase asset) | ||
25 | { | ||
26 | CreateAsset(asset); | ||
27 | } | ||
28 | |||
29 | public bool ExistsAsset(UUID uuid) | ||
30 | { | ||
31 | return Assets.ContainsKey(uuid); | ||
32 | } | ||
33 | } | ||
34 | } \ No newline at end of file | ||