aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Tests/MundaneFrameworkTests.cs')
-rw-r--r--OpenSim/Framework/Tests/MundaneFrameworkTests.cs42
1 files changed, 41 insertions, 1 deletions
diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
index 0c588eb..04be083 100644
--- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
+++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs
@@ -30,6 +30,8 @@ using OpenSim.Framework;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenMetaverse.StructuredData; 31using OpenMetaverse.StructuredData;
32using System; 32using System;
33using System.Globalization;
34using System.Threading;
33 35
34namespace OpenSim.Framework.Tests 36namespace OpenSim.Framework.Tests
35{ 37{
@@ -265,7 +267,45 @@ namespace OpenSim.Framework.Tests
265 Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field."); 267 Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field.");
266 } 268 }
267 269
268 270 [Test]
271 public void AsssetBaseConstructorTest01()
272 {
273 AssetBase abase = new AssetBase();
274 Assert.IsNotNull(abase.Metadata, "void constructor of AssetBase should have created a MetaData element but didn't.");
275 UUID itemID = UUID.Random();
276 UUID creatorID = UUID.Random();
277 abase = new AssetBase(itemID.ToString(), "test item", (sbyte) AssetType.Texture, creatorID.ToString());
278
279 Assert.IsNotNull(abase.Metadata, "string,string,sbyte,string constructor of AssetBase should have created a MetaData element but didn't.");
280 Assert.That(abase.ID == itemID.ToString(), "string,string,sbyte,string constructor failed to set ID property");
281 Assert.That(abase.Metadata.CreatorID == creatorID.ToString(), "string,string,sbyte,string constructor failed to set Creator ID");
282
283
284 abase = new AssetBase(itemID.ToString(), "test item", -1, creatorID.ToString());
285 Assert.IsNotNull(abase.Metadata, "string,string,sbyte,string constructor of AssetBase with unknown type should have created a MetaData element but didn't.");
286 Assert.That(abase.Metadata.Type == -1, "Unknown Type passed to string,string,sbyte,string constructor and was a known type when it came out again");
287
288 AssetMetadata metts = new AssetMetadata();
289 metts.FullID = itemID;
290 metts.ID = string.Empty;
291 metts.Name = "test item";
292 abase.Metadata = metts;
293
294 Assert.That(abase.ToString() == itemID.ToString(), "ToString is overriden to be fullID.ToString()");
295 Assert.That(abase.ID == itemID.ToString(),"ID should be MetaData.FullID.ToString() when string.empty or null is provided to the ID property");
296 }
297
298 [Test]
299 public void CultureSetCultureTest01()
300 {
301 CultureInfo ci = new CultureInfo("en-US", false);
302 Culture.SetCurrentCulture();
303 Assert.That(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US");
304
305 }
306
307
308
269 } 309 }
270} 310}
271 311