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

@@ -12,6 +12,8 @@ namespace Content.Tests.Shared;
[TestOf(typeof(LocalizedDatasetPrototype))]
public sealed class LocalizedDatasetPrototypeTest : ContentUnitTest
{
private const string TestDatasetId = "Test";
private IPrototypeManager _prototypeManager;
[OneTimeSetUp]
@@ -24,9 +26,9 @@ public sealed class LocalizedDatasetPrototypeTest : ContentUnitTest
_prototypeManager.ResolveResults();
}
private const string TestPrototypes = @"
private const string TestPrototypes = $@"
- type: localizedDataset
id: Test
id: {TestDatasetId}
values:
prefix: test-dataset-
count: 4
@@ -35,7 +37,7 @@ public sealed class LocalizedDatasetPrototypeTest : ContentUnitTest
[Test]
public void LocalizedDatasetTest()
{
var testPrototype = _prototypeManager.Index<LocalizedDatasetPrototype>("Test");
var testPrototype = _prototypeManager.Index<LocalizedDatasetPrototype>(TestDatasetId);
var values = new ValueList<string>();
foreach (var value in testPrototype.Values)
{