Refactored integration tests to not use content entity prototypes (#2571)
* Refactored integration tests to not use content prototypes * oops * Apply suggestions from code review Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -16,10 +16,51 @@ namespace Content.IntegrationTests.Tests
|
||||
[TestOf(typeof(HumanInventoryControllerComponent))]
|
||||
public class HumanInventoryUniformSlotsTest : ContentIntegrationTest
|
||||
{
|
||||
private const string PROTOTYPES = @"
|
||||
- type: entity
|
||||
name: HumanDummy
|
||||
id: HumanDummy
|
||||
components:
|
||||
- type: Inventory
|
||||
- type: HumanInventoryController
|
||||
|
||||
- type: entity
|
||||
name: UniformDummy
|
||||
id: UniformDummy
|
||||
components:
|
||||
- type: Clothing
|
||||
Slots: [innerclothing]
|
||||
size: 5
|
||||
|
||||
- type: entity
|
||||
name: IDCardDummy
|
||||
id: IDCardDummy
|
||||
components:
|
||||
- type: Clothing
|
||||
Slots:
|
||||
- idcard
|
||||
size: 5
|
||||
- type: IdCard
|
||||
|
||||
- type: entity
|
||||
name: FlashlightDummy
|
||||
id: FlashlightDummy
|
||||
components:
|
||||
- type: Item
|
||||
size: 5
|
||||
|
||||
- type: entity
|
||||
name: ToolboxDummy
|
||||
id: ToolboxDummy
|
||||
components:
|
||||
- type: Item
|
||||
size: 9999
|
||||
";
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
var server = StartServerDummyTicker();
|
||||
var options = new ServerIntegrationOptions{ExtraPrototypes = PROTOTYPES};
|
||||
var server = StartServerDummyTicker(options);
|
||||
|
||||
IEntity human = null;
|
||||
IEntity uniform = null;
|
||||
@@ -35,11 +76,11 @@ namespace Content.IntegrationTests.Tests
|
||||
|
||||
var entityMan = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
human = entityMan.SpawnEntity("HumanMob_Content", MapCoordinates.Nullspace);
|
||||
uniform = entityMan.SpawnEntity("UniformJanitor", MapCoordinates.Nullspace);
|
||||
idCard = entityMan.SpawnEntity("AssistantIDCard", MapCoordinates.Nullspace);
|
||||
pocketItem = entityMan.SpawnEntity("FlashlightLantern", MapCoordinates.Nullspace);
|
||||
var tooBigItem = entityMan.SpawnEntity("ToolboxEmergency", MapCoordinates.Nullspace);
|
||||
human = entityMan.SpawnEntity("HumanDummy", MapCoordinates.Nullspace);
|
||||
uniform = entityMan.SpawnEntity("UniformDummy", MapCoordinates.Nullspace);
|
||||
idCard = entityMan.SpawnEntity("IDCardDummy", MapCoordinates.Nullspace);
|
||||
pocketItem = entityMan.SpawnEntity("FlashlightDummy", MapCoordinates.Nullspace);
|
||||
var tooBigItem = entityMan.SpawnEntity("ToolboxDummy", MapCoordinates.Nullspace);
|
||||
|
||||
inventory = human.GetComponent<InventoryComponent>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user