aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
index 21a0093..9398971 100644
--- a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
+++ b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
@@ -42,9 +42,16 @@ namespace OpenSim.Data.SQLite.Tests
42 public string file = "inventorytest.db"; 42 public string file = "inventorytest.db";
43 public string connect; 43 public string connect;
44 public SQLiteInventoryStore db; 44 public SQLiteInventoryStore db;
45 public UUID zero = UUID.Zero;
45 public UUID uuid1; 46 public UUID uuid1;
46 public UUID uuid2; 47 public UUID uuid2;
47 public UUID uuid3; 48 public UUID uuid3;
49 public UUID owner1;
50 public UUID owner2;
51 public UUID owner3;
52 public string name1;
53 public string name2;
54 public string name3;
48 55
49 56
50 [TestFixtureSetUp] 57 [TestFixtureSetUp]
@@ -56,6 +63,10 @@ namespace OpenSim.Data.SQLite.Tests
56 uuid1 = UUID.Random(); 63 uuid1 = UUID.Random();
57 uuid2 = UUID.Random(); 64 uuid2 = UUID.Random();
58 uuid3 = UUID.Random(); 65 uuid3 = UUID.Random();
66 owner1 = UUID.Random();
67 owner2 = UUID.Random();
68 owner3 = UUID.Random();
69 name1 = "Root Folder for " + owner1.ToString();
59 } 70 }
60 71
61 [TestFixtureTearDown] 72 [TestFixtureTearDown]
@@ -68,6 +79,36 @@ namespace OpenSim.Data.SQLite.Tests
68 public void T001_LoadEmpty() 79 public void T001_LoadEmpty()
69 { 80 {
70 Assert.That(db.getInventoryItem(uuid1), Is.Null); 81 Assert.That(db.getInventoryItem(uuid1), Is.Null);
82 Assert.That(db.getUserRootFolder(owner1), Is.Null);
83 }
84
85 // 01x - folder tests
86 [Test]
87 public void T010_FolderCreate()
88 {
89 InventoryFolderBase f1 = NewFolder(uuid1, zero, owner1, name1);
90 // TODO: this is probably wrong behavior, but is what we have
91 // db.updateInventoryFolder(f1);
92 // InventoryFolderBase f1a = db.getUserRootFolder(owner1);
93 // Assert.That(uuid1, Is.EqualTo(f1a.ID))
94 // Assert.That(name1, Text.Matches(f1a.Name));
95 // Assert.That(db.getUserRootFolder(owner1), Is.Null);
96
97 // succeed with true
98 db.addInventoryFolder(f1);
99 InventoryFolderBase f1a = db.getUserRootFolder(owner1);
100 Assert.That(uuid1, Is.EqualTo(f1a.ID));
101 Assert.That(name1, Text.Matches(f1a.Name));
102 }
103
104 private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name)
105 {
106 InventoryFolderBase f = new InventoryFolderBase();
107 f.ID = id;
108 f.ParentID = parent;
109 f.Owner = owner;
110 f.Name = name;
111 return f;
71 } 112 }
72 } 113 }
73} \ No newline at end of file 114} \ No newline at end of file