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

@@ -15,6 +15,8 @@ namespace Content.IntegrationTests.Tests.Commands
[TestOf(typeof(RejuvenateSystem))]
public sealed class RejuvenateTest
{
private static readonly ProtoId<DamageGroupPrototype> TestDamageGroup = "Toxin";
[TestPrototypes]
private const string Prototypes = @"
- type: entity
@@ -62,7 +64,7 @@ namespace Content.IntegrationTests.Tests.Commands
});
// Kill the entity
DamageSpecifier damage = new(prototypeManager.Index<DamageGroupPrototype>("Toxin"), FixedPoint2.New(10000000));
DamageSpecifier damage = new(prototypeManager.Index(TestDamageGroup), FixedPoint2.New(10000000));
damSystem.TryChangeDamage(human, damage, true);