aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests/BasicAssetTest.cs
diff options
context:
space:
mode:
authorKunnis2009-08-09 02:01:21 -0500
committerTeravus Ovares (Dan Olivares)2009-08-16 13:35:44 -0400
commit23d478f2fa06d1dedabfb24cf6ff763b586173ce (patch)
tree072fdcfe343d84cf01b0881045fc96fb8403c324 /OpenSim/Data/Tests/BasicAssetTest.cs
parentAdd copyright header. Formatting cleanup. (diff)
downloadopensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.zip
opensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.gz
opensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.bz2
opensim-SC-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.xz
Adding in Reflection-based testing, to ensure that all properties are covered.
Diffstat (limited to 'OpenSim/Data/Tests/BasicAssetTest.cs')
-rw-r--r--OpenSim/Data/Tests/BasicAssetTest.cs19
1 files changed, 12 insertions, 7 deletions
diff --git a/OpenSim/Data/Tests/BasicAssetTest.cs b/OpenSim/Data/Tests/BasicAssetTest.cs
index e85a6a7..eddb999 100644
--- a/OpenSim/Data/Tests/BasicAssetTest.cs
+++ b/OpenSim/Data/Tests/BasicAssetTest.cs
@@ -32,7 +32,6 @@ using NUnit.Framework.SyntaxHelpers;
32using OpenMetaverse; 32using OpenMetaverse;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using log4net; 34using log4net;
35using System.Reflection;
36 35
37namespace OpenSim.Data.Tests 36namespace OpenSim.Data.Tests
38{ 37{
@@ -77,25 +76,31 @@ namespace OpenSim.Data.Tests
77 AssetBase a1 = new AssetBase(uuid1, "asset one"); 76 AssetBase a1 = new AssetBase(uuid1, "asset one");
78 AssetBase a2 = new AssetBase(uuid2, "asset two"); 77 AssetBase a2 = new AssetBase(uuid2, "asset two");
79 AssetBase a3 = new AssetBase(uuid3, "asset three"); 78 AssetBase a3 = new AssetBase(uuid3, "asset three");
79
80 ScrambleForTesting.Scramble(a1);
81 ScrambleForTesting.Scramble(a2);
82 ScrambleForTesting.Scramble(a3);
83
80 a1.Data = asset1; 84 a1.Data = asset1;
81 a2.Data = asset1; 85 a2.Data = asset1;
82 a3.Data = asset1; 86 a3.Data = asset1;
83 87
88 a1.FullID = uuid1;
89 a2.FullID = uuid2;
90 a3.FullID = uuid3;
91
84 db.CreateAsset(a1); 92 db.CreateAsset(a1);
85 db.CreateAsset(a2); 93 db.CreateAsset(a2);
86 db.CreateAsset(a3); 94 db.CreateAsset(a3);
87 95
88 AssetBase a1a = db.FetchAsset(uuid1); 96 AssetBase a1a = db.FetchAsset(uuid1);
89 Assert.That(a1.ID, Is.EqualTo(a1a.ID), "Assert.That(a1.ID, Is.EqualTo(a1a.ID))"); 97 Assert.That(a1, Constraints.PropertyCompareConstraint(a1a));
90 Assert.That(a1.Name, Is.EqualTo(a1a.Name), "Assert.That(a1.Name, Is.EqualTo(a1a.Name))");
91 98
92 AssetBase a2a = db.FetchAsset(uuid2); 99 AssetBase a2a = db.FetchAsset(uuid2);
93 Assert.That(a2.ID, Is.EqualTo(a2a.ID), "Assert.That(a2.ID, Is.EqualTo(a2a.ID))"); 100 Assert.That(a2, Constraints.PropertyCompareConstraint(a2a));
94 Assert.That(a2.Name, Is.EqualTo(a2a.Name), "Assert.That(a2.Name, Is.EqualTo(a2a.Name))");
95 101
96 AssetBase a3a = db.FetchAsset(uuid3); 102 AssetBase a3a = db.FetchAsset(uuid3);
97 Assert.That(a3.ID, Is.EqualTo(a3a.ID), "Assert.That(a3.ID, Is.EqualTo(a3a.ID))"); 103 Assert.That(a3, Constraints.PropertyCompareConstraint(a3a));
98 Assert.That(a3.Name, Is.EqualTo(a3a.Name), "Assert.That(a3.Name, Is.EqualTo(a3a.Name))");
99 } 104 }
100 105
101 [Test] 106 [Test]