refactor: extract another test asset helper method
parent
ed1089d892
commit
e2b1fb8ff9
|
@ -34,6 +34,7 @@ using OpenSim.Framework;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using OpenSim.Tests.Common;
|
using OpenSim.Tests.Common;
|
||||||
|
using OpenSim.Tests.Common.Setup;
|
||||||
using OpenSim.Tests.Common.Mock;
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Scenes.Tests
|
namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
|
@ -55,11 +56,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
public void TestCorruptAsset()
|
public void TestCorruptAsset()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelper.InMethod();
|
||||||
|
|
||||||
UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
||||||
AssetBase corruptAsset = new AssetBase(corruptAssetUuid, corruptAssetUuid.ToString(), (sbyte)AssetType.Object);
|
AssetBase corruptAsset = AssetHelpers.CreateAsset(corruptAssetUuid, "CORRUPT ASSET");
|
||||||
corruptAsset.Data = Encoding.ASCII.GetBytes("CORRUPT ASSET");
|
|
||||||
|
|
||||||
m_assetService.Store(corruptAsset);
|
m_assetService.Store(corruptAsset);
|
||||||
|
|
||||||
IDictionary<UUID, int> foundAssetUuids = new Dictionary<UUID, int>();
|
IDictionary<UUID, int> foundAssetUuids = new Dictionary<UUID, int>();
|
||||||
|
|
|
@ -35,6 +35,19 @@ namespace OpenSim.Tests.Common
|
||||||
{
|
{
|
||||||
public class AssetHelpers
|
public class AssetHelpers
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Create an asset from the given data
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="assetUuid"></param>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static AssetBase CreateAsset(UUID assetUuid, string data)
|
||||||
|
{
|
||||||
|
AssetBase asset = new AssetBase(assetUuid, assetUuid.ToString(), (sbyte)AssetType.Object);
|
||||||
|
asset.Data = Encoding.ASCII.GetBytes(data);
|
||||||
|
return asset;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create an asset from the given scene object
|
/// Create an asset from the given scene object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue