Validate ProtoIds in tests (#38745)

* Convert string literals to protoids in Content.Tests

* Convert string literals to protoids or consts in Content.IntegrationTests

* Fix linter failures
Tricksy static using misled me
This commit is contained in:
Tayrtahn
2025-07-04 16:48:55 -04:00
committed by GitHub
parent c3267c6db0
commit 3a278bca8b
17 changed files with 129 additions and 83 deletions

View File

@@ -7,10 +7,12 @@ namespace Content.IntegrationTests.Tests.Atmos
[TestOf(typeof(AtmosAlarmThreshold))]
public sealed class AlarmThresholdTest
{
private const string AlarmThresholdTestDummyId = "AlarmThresholdTestDummy";
[TestPrototypes]
private const string Prototypes = @"
private const string Prototypes = $@"
- type: alarmThreshold
id: AlarmThresholdTestDummy
id: {AlarmThresholdTestDummyId}
upperBound: !type:AlarmThresholdSetting
threshold: 5
lowerBound: !type:AlarmThresholdSetting
@@ -30,7 +32,7 @@ namespace Content.IntegrationTests.Tests.Atmos
var prototypeManager = server.ResolveDependency<IPrototypeManager>();
AtmosAlarmThreshold threshold = default!;
var proto = prototypeManager.Index<AtmosAlarmThresholdPrototype>("AlarmThresholdTestDummy");
var proto = prototypeManager.Index<AtmosAlarmThresholdPrototype>(AlarmThresholdTestDummyId);
threshold = new(proto);
await server.WaitAssertion(() =>