* More improvements to BasicAssetTest.cs

arthursv
Kunnis 2009-08-15 23:43:52 -05:00 committed by Teravus Ovares (Dan Olivares)
parent d2e5380cb2
commit 5dde4a4cfa
2 changed files with 13 additions and 26 deletions

View File

@ -26,6 +26,7 @@
*/ */
using System; using System;
using System.Collections.Generic;
using log4net.Config; using log4net.Config;
using NUnit.Framework; using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers; using NUnit.Framework.SyntaxHelpers;
@ -37,8 +38,7 @@ namespace OpenSim.Data.Tests
{ {
public class BasicAssetTest public class BasicAssetTest
{ {
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public IAssetDataPlugin db;
public AssetDataBase db;
public UUID uuid1; public UUID uuid1;
public UUID uuid2; public UUID uuid2;
public UUID uuid3; public UUID uuid3;
@ -46,14 +46,7 @@ namespace OpenSim.Data.Tests
public void SuperInit() public void SuperInit()
{ {
try OpenSim.Tests.Common.TestLogging.LogToConsole();
{
XmlConfigurator.Configure();
}
catch (Exception)
{
// I don't care, just leave log4net off
}
uuid1 = UUID.Random(); uuid1 = UUID.Random();
uuid2 = UUID.Random(); uuid2 = UUID.Random();
@ -126,26 +119,19 @@ namespace OpenSim.Data.Tests
AssetBase a3b = db.FetchAsset(uuid3); AssetBase a3b = db.FetchAsset(uuid3);
Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a)); Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a));
}
[Test]
public void T011_ExistsSimpleAsset()
{
Assert.That(db.ExistsAsset(uuid1), Is.True); Assert.That(db.ExistsAsset(uuid1), Is.True);
Assert.That(db.ExistsAsset(uuid2), Is.True); Assert.That(db.ExistsAsset(uuid2), Is.True);
Assert.That(db.ExistsAsset(uuid3), Is.True); Assert.That(db.ExistsAsset(uuid3), Is.True);
}
// this has questionable use, but it is in the interface at the moment. List<AssetMetadata> metadatas = db.FetchAssetMetadataSet(0, 1000);
// [Test]
// public void T012_DeleteAsset() AssetMetadata metadata = metadatas.Find(x => x.FullID == uuid1);
// { Assert.That(metadata.Name, Is.EqualTo(a1b.Name));
// db.DeleteAsset(uuid1); Assert.That(metadata.Description, Is.EqualTo(a1b.Description));
// db.DeleteAsset(uuid2); Assert.That(metadata.Type, Is.EqualTo(a1b.Type));
// db.DeleteAsset(uuid3); Assert.That(metadata.Temporary, Is.EqualTo(a1b.Temporary));
// Assert.That(db.ExistsAsset(uuid1), Is.False); Assert.That(metadata.FullID, Is.EqualTo(a1b.FullID));
// Assert.That(db.ExistsAsset(uuid2), Is.False); }
// Assert.That(db.ExistsAsset(uuid3), Is.False);
// }
} }
} }

View File

@ -3335,6 +3335,7 @@
<Reference name="OpenSim.Data"/> <Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Region.Framework"/> <Reference name="OpenSim.Region.Framework"/>
<Reference name="OpenSim.Region.CoreModules"/> <Reference name="OpenSim.Region.CoreModules"/>
<Reference name="OpenSim.Tests.Common"/>
<Reference name="log4net.dll"/> <Reference name="log4net.dll"/>
<Reference name="Mono.Addins.dll" /> <Reference name="Mono.Addins.dll" />
<Reference name="nunit.framework.dll" /> <Reference name="nunit.framework.dll" />