Cleanup integration tests prototype usage, naming and unused variables (#3114)

* Fix naming of prototypes variable in tests

* Remove unused variables in tests

* Remove unused variables in tests

* Replace content entities with test entities

* Fix airlock and lung test
This commit is contained in:
DrSmugleaf
2021-02-09 22:04:47 +01:00
committed by GitHub
parent 327257b8a4
commit 294b7c4d7f
22 changed files with 135 additions and 115 deletions

View File

@@ -17,7 +17,7 @@ namespace Content.IntegrationTests.Tests.Body
[TestOf(typeof(BodyComponent))]
public class LegTest : ContentIntegrationTest
{
private const string PROTOTYPES = @"
private const string Prototypes = @"
- type: entity
name: HumanBodyAndAppearanceDummy
id: HumanBodyAndAppearanceDummy
@@ -32,7 +32,7 @@ namespace Content.IntegrationTests.Tests.Body
[Test]
public async Task RemoveLegsFallTest()
{
var options = new ServerContentIntegrationOption{ExtraPrototypes = PROTOTYPES};
var options = new ServerContentIntegrationOption{ExtraPrototypes = Prototypes};
var server = StartServerDummyTicker(options);
AppearanceComponent appearance = null;

View File

@@ -8,7 +8,6 @@ using Content.Server.GameObjects.Components.Body.Circulatory;
using Content.Server.GameObjects.Components.Metabolism;
using Content.Shared.Atmos;
using Content.Shared.GameObjects.Components.Body;
using Content.Shared.GameObjects.Components.Body.Mechanism;
using NUnit.Framework;
using Robust.Server.Interfaces.Maps;
using Robust.Shared.Interfaces.GameObjects;
@@ -23,7 +22,7 @@ namespace Content.IntegrationTests.Tests.Body
[TestOf(typeof(LungBehavior))]
public class LungTest : ContentIntegrationTest
{
private const string PROTOTYPES = @"
private const string Prototypes = @"
- type: entity
name: HumanBodyAndBloodstreamDummy
id: HumanBodyAndBloodstreamDummy
@@ -52,7 +51,7 @@ namespace Content.IntegrationTests.Tests.Body
[Test]
public async Task AirConsistencyTest()
{
var options = new ServerContentIntegrationOption{ExtraPrototypes = PROTOTYPES};
var options = new ServerContentIntegrationOption{ExtraPrototypes = Prototypes};
var server = StartServerDummyTicker(options);
server.Assert(() =>
@@ -139,7 +138,9 @@ namespace Content.IntegrationTests.Tests.Body
[Test]
public async Task NoSuffocationTest()
{
var server = StartServerDummyTicker();
var options = new ServerContentIntegrationOption{ExtraPrototypes = Prototypes};
var server = StartServerDummyTicker(options);
await server.WaitIdleAsync();
var mapLoader = server.ResolveDependency<IMapLoader>();
@@ -165,7 +166,7 @@ namespace Content.IntegrationTests.Tests.Body
{
var center = new Vector2(0.5f, -1.5f);
var coordinates = new EntityCoordinates(grid.GridEntityId, center);
human = entityManager.SpawnEntity("HumanMob_Content", coordinates);
human = entityManager.SpawnEntity("HumanBodyAndBloodstreamDummy", coordinates);
Assert.True(human.TryGetComponent(out IBody body));
Assert.True(body.HasMechanismBehavior<LungBehavior>());

View File

@@ -3,7 +3,6 @@ using System.Linq;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Body.Behavior;
using Content.Shared.GameObjects.Components.Body;
using Content.Shared.GameObjects.Components.Body.Behavior;
using Content.Shared.GameObjects.Components.Body.Mechanism;
using Content.Shared.GameObjects.Components.Body.Part;
using NUnit.Framework;
@@ -103,7 +102,7 @@ namespace Content.IntegrationTests.Tests.Body
}
}
private const string PROTOTYPES = @"
private const string Prototypes = @"
- type: entity
name: HumanBodyDummy
id: HumanBodyDummy
@@ -117,7 +116,7 @@ namespace Content.IntegrationTests.Tests.Body
[Test]
public async Task EventsTest()
{
var options = new ServerContentIntegrationOption {ExtraPrototypes = PROTOTYPES};
var options = new ServerContentIntegrationOption {ExtraPrototypes = Prototypes};
var server = StartServerDummyTicker(options);
await server.WaitAssertion(() =>