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

@@ -20,6 +20,8 @@ namespace Content.IntegrationTests.Tests
[TestOf(typeof(VendingMachineSystem))]
public sealed class VendingMachineRestockTest : EntitySystem
{
private static readonly ProtoId<DamageTypePrototype> TestDamageType = "Blunt";
[TestPrototypes]
private const string Prototypes = @"
- type: entity
@@ -293,7 +295,7 @@ namespace Content.IntegrationTests.Tests
"Did not start with zero ramen.");
restock = entityManager.SpawnEntity("TestRestockExplode", coordinates);
var damageSpec = new DamageSpecifier(prototypeManager.Index<DamageTypePrototype>("Blunt"), 100);
var damageSpec = new DamageSpecifier(prototypeManager.Index(TestDamageType), 100);
var damageResult = damageableSystem.TryChangeDamage(restock, damageSpec);
#pragma warning disable NUnit2045