mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
* Added some more tests to the GetAssetStreamHandlers
This commit is contained in:
34
OpenSim/Tests/Common/Mock/BaseAssetRepository.cs
Normal file
34
OpenSim/Tests/Common/Mock/BaseAssetRepository.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Tests.Common.Mock
|
||||
{
|
||||
public class BaseAssetRepository
|
||||
{
|
||||
protected Dictionary<UUID, AssetBase> Assets = new Dictionary<UUID, AssetBase>();
|
||||
|
||||
public AssetBase FetchAsset(UUID uuid)
|
||||
{
|
||||
if (ExistsAsset(uuid))
|
||||
return Assets[uuid];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public void CreateAsset(AssetBase asset)
|
||||
{
|
||||
Assets[asset.FullID] = asset;
|
||||
}
|
||||
|
||||
public void UpdateAsset(AssetBase asset)
|
||||
{
|
||||
CreateAsset(asset);
|
||||
}
|
||||
|
||||
public bool ExistsAsset(UUID uuid)
|
||||
{
|
||||
return Assets.ContainsKey(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user