Add passing but incomplete NPC move regression test

bulletsim
Justin Clark-Casey (justincc) 2011-08-03 22:51:46 +01:00
parent e0503d397c
commit d78fe44191
1 changed files with 25 additions and 47 deletions

View File

@ -53,12 +53,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
// log4net.Config.XmlConfigurator.Configure();
IConfigSource config = new IniConfigSource();
// config.AddConfig("Modules");
// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector");
// config.AddConfig("AvatarService");
// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService");
// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
config.AddConfig("NPC");
config.Configs["NPC"].Set("Enabled", "true");
@ -89,46 +83,30 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId));
}
// [Test]
// public void TestMove()
// {
// TestHelper.InMethod();
//// log4net.Config.XmlConfigurator.Configure();
//
// IConfigSource config = new IniConfigSource();
//
// config.AddConfig("Modules");
// config.Configs["Modules"].Set("AvatarServices", "LocalAvatarServicesConnector");
// config.AddConfig("AvatarService");
// config.Configs["AvatarService"].Set("LocalServiceModule", "OpenSim.Services.AvatarService.dll:AvatarService");
// config.Configs["AvatarService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
// config.AddConfig("NPC");
// config.Configs["NPC"].Set("Enabled", "true");
//
// TestScene scene = SceneSetupHelpers.SetupScene();
// SceneSetupHelpers.SetupSceneModules(scene, config, afm, new NPCModule(), new LocalAvatarServicesConnector());
// TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1));
//// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
//
// // 8 is the index of the first baked texture in AvatarAppearance
// UUID originalFace8TextureId = TestHelper.ParseTail(0x10);
// Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero);
// Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8);
// originalTef.TextureID = originalFace8TextureId;
//
// // We also need to add the texture to the asset service, otherwise the AvatarFactoryModule will tell
// // ScenePresence.SendInitialData() to reset our entire appearance.
// scene.AssetService.Store(AssetHelpers.CreateAsset(originalFace8TextureId));
//
// afm.SetAppearance(originalClient, originalTe, null);
//
// INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
// UUID npcId = npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), scene, originalClient.AgentId);
//
// ScenePresence npc = scene.GetScenePresence(npcId);
//
// Assert.That(npc, Is.Not.Null);
// Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId));
// }
[Test]
public void TestMove()
{
TestHelper.InMethod();
log4net.Config.XmlConfigurator.Configure();
IConfigSource config = new IniConfigSource();
config.AddConfig("NPC");
config.Configs["NPC"].Set("Enabled", "true");
TestScene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, config, new NPCModule());
TestClient originalClient = SceneSetupHelpers.AddClient(scene, TestHelper.ParseTail(0x1));
// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
Vector3 startPos = new Vector3(128, 128, 30);
INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, originalClient.AgentId);
ScenePresence npc = scene.GetScenePresence(npcId);
Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
// Not yet complete
}
}
}