diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs index 4e58315..b49bcc2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs | |||
@@ -127,11 +127,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
127 | OSSL_Api osslApi = new OSSL_Api(); | 127 | OSSL_Api osslApi = new OSSL_Api(); |
128 | osslApi.Initialize(m_engine, so.RootPart, null); | 128 | osslApi.Initialize(m_engine, so.RootPart, null); |
129 | 129 | ||
130 | string npcRaw | 130 | string npcRaw; |
131 | = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), "not existing notecard name"); | 131 | bool gotExpectedException = false; |
132 | 132 | try | |
133 | UUID npcId = new UUID(npcRaw); | 133 | { |
134 | Assert.That(npcId, Is.EqualTo(UUID.Zero)); | 134 | npcRaw |
135 | = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), "not existing notecard name"); | ||
136 | } | ||
137 | catch (ScriptException) | ||
138 | { | ||
139 | gotExpectedException = true; | ||
140 | } | ||
141 | |||
142 | Assert.That(gotExpectedException, Is.True); | ||
135 | } | 143 | } |
136 | 144 | ||
137 | /// <summary> | 145 | /// <summary> |
@@ -233,7 +241,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests | |||
233 | string npcRaw | 241 | string npcRaw |
234 | = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), firstAppearanceNcName); | 242 | = osslApi.osNpcCreate("Jane", "Doe", new LSL_Types.Vector3(128, 128, 128), firstAppearanceNcName); |
235 | 243 | ||
236 | osslApi.osNpcLoadAppearance(npcRaw, secondAppearanceNcName); | 244 | bool gotExpectedException = false; |
245 | try | ||
246 | { | ||
247 | osslApi.osNpcLoadAppearance(npcRaw, secondAppearanceNcName); | ||
248 | } | ||
249 | catch (ScriptException) | ||
250 | { | ||
251 | gotExpectedException = true; | ||
252 | } | ||
253 | |||
254 | Assert.That(gotExpectedException, Is.True); | ||
237 | 255 | ||
238 | UUID npcId = new UUID(npcRaw); | 256 | UUID npcId = new UUID(npcRaw); |
239 | ScenePresence npc = m_scene.GetScenePresence(npcId); | 257 | ScenePresence npc = m_scene.GetScenePresence(npcId); |