diff options
author | Justin Clark-Casey (justincc) | 2011-05-21 00:25:58 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-05-21 00:25:58 +0100 |
commit | 9103fe84d51c21d58c129fd0245c47b0a2b35c60 (patch) | |
tree | a425ea8deb0c572b241acce5af7b8c44f7476092 /OpenSim/Region | |
parent | refactor: use SceneSetupHelpers.CreateSceneObject() (diff) | |
download | opensim-SC-9103fe84d51c21d58c129fd0245c47b0a2b35c60.zip opensim-SC-9103fe84d51c21d58c129fd0245c47b0a2b35c60.tar.gz opensim-SC-9103fe84d51c21d58c129fd0245c47b0a2b35c60.tar.bz2 opensim-SC-9103fe84d51c21d58c129fd0245c47b0a2b35c60.tar.xz |
move test task inventory notecard item creation into a new TastInventoryHelpers class
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 717517b..1c8f078 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -53,25 +53,6 @@ namespace OpenSim.Region.Framework.Tests | |||
53 | [TestFixture] | 53 | [TestFixture] |
54 | public class TaskInventoryTests | 54 | public class TaskInventoryTests |
55 | { | 55 | { |
56 | protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part) | ||
57 | { | ||
58 | AssetNotecard nc = new AssetNotecard(); | ||
59 | nc.BodyText = "Hello World!"; | ||
60 | nc.Encode(); | ||
61 | UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); | ||
62 | UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); | ||
63 | AssetBase ncAsset | ||
64 | = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); | ||
65 | scene.AssetService.Store(ncAsset); | ||
66 | TaskInventoryItem ncItem | ||
67 | = new TaskInventoryItem | ||
68 | { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid, | ||
69 | Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard }; | ||
70 | part.Inventory.AddInventoryItem(ncItem, true); | ||
71 | |||
72 | return ncItem; | ||
73 | } | ||
74 | |||
75 | [Test] | 56 | [Test] |
76 | public void TestRezObjectFromInventoryItem() | 57 | public void TestRezObjectFromInventoryItem() |
77 | { | 58 | { |
@@ -132,7 +113,7 @@ namespace OpenSim.Region.Framework.Tests | |||
132 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); | 113 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); |
133 | SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID); | 114 | SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID); |
134 | SceneObjectPart sop1 = sog1.RootPart; | 115 | SceneObjectPart sop1 = sog1.RootPart; |
135 | TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1); | 116 | TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1); |
136 | InventoryFolderBase folder | 117 | InventoryFolderBase folder |
137 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; | 118 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; |
138 | 119 | ||
@@ -158,7 +139,7 @@ namespace OpenSim.Region.Framework.Tests | |||
158 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); | 139 | UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene); |
159 | SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID); | 140 | SceneObjectGroup sog1 = SceneSetupHelpers.CreateSceneObject(1, user1.PrincipalID); |
160 | SceneObjectPart sop1 = sog1.RootPart; | 141 | SceneObjectPart sop1 = sog1.RootPart; |
161 | TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1); | 142 | TaskInventoryItem sopItem1 = TaskInventoryHelpers.AddNotecard(scene, sop1); |
162 | 143 | ||
163 | // Perform test | 144 | // Perform test |
164 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); | 145 | scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); |