Code Cleanup: Integration Tests (#29584)

* Cleanup PuddleTest

* Cleanup GravityGridTest

* Cleanup PowerTest

* Cleanup SaveLoadMapTest

* Cleanup Body tests

* Cleanup ContainerOcclusionTest

* Cleanup AirlockTest

* Cleanup DamageableTest

* Cleanup EntityTest

* Cleanup FluidSpillTest

* Cleanup FollowerSystemTest

* Cleanup HandCuffTest

* Cleanup InteractionSystemTests

* Cleanup InRangeUnobstructed

* Cleanup SimplePredictReconcileTest

* Cleanup PostMapInitTest

* Cleanup SalvageTest

* Cleanup SaveLoadSaveTest

* Cleanup ShuttleTest

* Cleanup MaterialArbitrageTest

* Cleanup PrototypeSaveTest

* Fix ShuttleTest

* Bunch of small ones

* Move JobTests to Station directory

* More small fixes

* Cleanup InteractionTest.Helpers
Had to change a method signature, so some callers were modified too.

* Missed one
This commit is contained in:
Tayrtahn
2024-07-02 20:01:37 -04:00
committed by GitHub
parent 58d46ddd46
commit cfc0247e5c
56 changed files with 510 additions and 491 deletions

View File

@@ -38,15 +38,16 @@ public sealed class MaterialArbitrageTest
await server.WaitIdleAsync();
var entManager = server.ResolveDependency<IEntityManager>();
var sysManager = server.ResolveDependency<IEntitySystemManager>();
var mapManager = server.ResolveDependency<IMapManager>();
Assert.That(mapManager.IsMapInitialized(testMap.MapId));
var protoManager = server.ResolveDependency<IPrototypeManager>();
var pricing = sysManager.GetEntitySystem<PricingSystem>();
var stackSys = sysManager.GetEntitySystem<StackSystem>();
var pricing = entManager.System<PricingSystem>();
var stackSys = entManager.System<StackSystem>();
var mapSystem = server.System<SharedMapSystem>();
var compFact = server.ResolveDependency<IComponentFactory>();
Assert.That(mapSystem.IsInitialized(testMap.MapId));
var constructionName = compFact.GetComponentName(typeof(ConstructionComponent));
var compositionName = compFact.GetComponentName(typeof(PhysicalCompositionComponent));
var materialName = compFact.GetComponentName(typeof(MaterialComponent));
@@ -67,7 +68,7 @@ public sealed class MaterialArbitrageTest
Dictionary<string, ConstructionComponent> constructionRecipes = new();
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (proto.NoSpawn || proto.Abstract || pair.IsTestPrototype(proto))
if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto))
continue;
if (!proto.Components.TryGetValue(constructionName, out var destructible))
@@ -127,7 +128,7 @@ public sealed class MaterialArbitrageTest
// Here we get the set of entities/materials spawned when destroying an entity.
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (proto.NoSpawn || proto.Abstract || pair.IsTestPrototype(proto))
if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto))
continue;
if (!proto.Components.TryGetValue(destructibleName, out var destructible))
@@ -298,7 +299,7 @@ public sealed class MaterialArbitrageTest
Dictionary<string, PhysicalCompositionComponent> physicalCompositions = new();
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (proto.NoSpawn || proto.Abstract || pair.IsTestPrototype(proto))
if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto))
continue;
if (!proto.Components.TryGetValue(compositionName, out var composition))