-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/wizards/master'
# Conflicts: # Resources/Prototypes/lobbyscreens.yml # Resources/Textures/LobbyScreens/attributions.yml # Resources/Textures/LobbyScreens/blueprint.webp.yml # Resources/Textures/LobbyScreens/justaweekaway.webp.yml
- Loading branch information
Showing
15 changed files
with
1,651 additions
and
1,810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
Content.IntegrationTests/Tests/Internals/AutoInternalsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using Content.Server.Atmos.EntitySystems; | ||
using Content.Server.Body.Systems; | ||
using Content.Server.Station.Systems; | ||
using Content.Shared.Preferences; | ||
using Content.Shared.Roles.Jobs; | ||
|
||
namespace Content.IntegrationTests.Tests.Internals; | ||
|
||
[TestFixture] | ||
[TestOf(typeof(InternalsSystem))] | ||
public sealed class AutoInternalsTests | ||
{ | ||
[Test] | ||
public async Task TestInternalsAutoActivateInSpaceForStationSpawn() | ||
{ | ||
await using var pair = await PoolManager.GetServerClient(); | ||
var server = pair.Server; | ||
|
||
var testMap = await pair.CreateTestMap(); | ||
|
||
var stationSpawning = server.System<StationSpawningSystem>(); | ||
var atmos = server.System<AtmosphereSystem>(); | ||
var internals = server.System<InternalsSystem>(); | ||
|
||
await server.WaitAssertion(() => | ||
{ | ||
var profile = new HumanoidCharacterProfile(); | ||
var dummy = stationSpawning.SpawnPlayerMob(testMap.GridCoords, new JobComponent() | ||
{ | ||
Prototype = "TestInternalsDummy" | ||
}, profile, station: null); | ||
|
||
Assert.That(atmos.HasAtmosphere(testMap.Grid), Is.False, "Test map has atmosphere - test needs adjustment!"); | ||
Assert.That(internals.AreInternalsWorking(dummy), "Internals did not automatically connect!"); | ||
|
||
server.EntMan.DeleteEntity(dummy); | ||
}); | ||
|
||
await pair.CleanReturnAsync(); | ||
} | ||
|
||
[Test] | ||
public async Task TestInternalsAutoActivateInSpaceForEntitySpawn() | ||
{ | ||
await using var pair = await PoolManager.GetServerClient(); | ||
var server = pair.Server; | ||
|
||
var testMap = await pair.CreateTestMap(); | ||
|
||
var atmos = server.System<AtmosphereSystem>(); | ||
var internals = server.System<InternalsSystem>(); | ||
|
||
await server.WaitAssertion(() => | ||
{ | ||
var dummy = server.EntMan.Spawn("TestInternalsDummyEntity", testMap.MapCoords); | ||
|
||
Assert.That(atmos.HasAtmosphere(testMap.Grid), Is.False, "Test map has atmosphere - test needs adjustment!"); | ||
Assert.That(internals.AreInternalsWorking(dummy), "Internals did not automatically connect!"); | ||
|
||
server.EntMan.DeleteEntity(dummy); | ||
}); | ||
|
||
await pair.CleanReturnAsync(); | ||
} | ||
|
||
[TestPrototypes] | ||
private const string Prototypes = @" | ||
- type: playTimeTracker | ||
id: PlayTimeInternalsDummy | ||
- type: startingGear | ||
id: InternalsDummyGear | ||
equipment: | ||
mask: ClothingMaskBreath | ||
suitstorage: OxygenTankFilled | ||
- type: job | ||
id: TestInternalsDummy | ||
playTimeTracker: PlayTimeInternalsDummy | ||
startingGear: InternalsDummyGear | ||
- type: entity | ||
id: TestInternalsDummyEntity | ||
parent: MobHuman | ||
components: | ||
- type: Loadout | ||
prototypes: [InternalsDummyGear] | ||
"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.