Fix content.integration tests warnings (#17817)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
TemporalOroboros
2023-07-05 21:54:25 -07:00
committed by GitHub
parent 20c1754abd
commit ba91023a85
121 changed files with 3658 additions and 1961 deletions

View File

@@ -1,9 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Content.Shared.Lathe;
using Content.Shared.Research.Prototypes;
using NUnit.Framework;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests;
@@ -14,7 +12,7 @@ public sealed class ResearchTest
[Test]
public async Task DisciplineValidTierPrerequesitesTest()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings {NoClient = true});
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings { NoClient = true });
var server = pairTracker.Pair.Server;
var protoManager = server.ResolveDependency<IPrototypeManager>();
@@ -23,23 +21,25 @@ public sealed class ResearchTest
{
var allTechs = protoManager.EnumeratePrototypes<TechnologyPrototype>().ToList();
foreach (var discipline in protoManager.EnumeratePrototypes<TechDisciplinePrototype>())
Assert.Multiple(() =>
{
foreach (var tech in allTechs)
foreach (var discipline in protoManager.EnumeratePrototypes<TechDisciplinePrototype>())
{
if (tech.Discipline != discipline.ID)
continue;
foreach (var tech in allTechs)
{
if (tech.Discipline != discipline.ID)
continue;
// we ignore these, anyways
if (tech.Tier == 1)
continue;
// we ignore these, anyways
if (tech.Tier == 1)
continue;
Assert.That(tech.Tier, Is.GreaterThan(0), $"Technology {tech} has invalid tier {tech.Tier}.");
Assert.That(discipline.TierPrerequisites.ContainsKey(tech.Tier),
$"Discipline {discipline.ID} does not have a TierPrerequisites definition for tier {tech.Tier}");
Assert.That(tech.Tier, Is.GreaterThan(0), $"Technology {tech} has invalid tier {tech.Tier}.");
Assert.That(discipline.TierPrerequisites.ContainsKey(tech.Tier),
$"Discipline {discipline.ID} does not have a TierPrerequisites definition for tier {tech.Tier}");
}
}
}
});
});
await pairTracker.CleanReturnAsync();
@@ -48,7 +48,7 @@ public sealed class ResearchTest
[Test]
public async Task AllTechPrintableTest()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings {NoClient = true});
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings { NoClient = true });
var server = pairTracker.Pair.Server;
var protoManager = server.ResolveDependency<IPrototypeManager>();
@@ -79,13 +79,16 @@ public sealed class ResearchTest
}
}
foreach (var tech in protoManager.EnumeratePrototypes<TechnologyPrototype>())
Assert.Multiple(() =>
{
foreach (var recipe in tech.RecipeUnlocks)
foreach (var tech in protoManager.EnumeratePrototypes<TechnologyPrototype>())
{
Assert.That(latheTechs, Does.Contain(recipe), $"Recipe \"{recipe}\" cannot be unlocked on any lathes.");
foreach (var recipe in tech.RecipeUnlocks)
{
Assert.That(latheTechs, Does.Contain(recipe), $"Recipe \"{recipe}\" cannot be unlocked on any lathes.");
}
}
}
});
});
await pairTracker.CleanReturnAsync();