Files
tbd-station-14/Content.IntegrationTests/Tests/StorageFillTest.cs
metalgearsloth 378d95ff6b Remove reagent test (#5593)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2021-11-28 23:05:13 +11:00

35 lines
1.2 KiB
C#

#nullable enable
using System.Threading.Tasks;
using Content.Server.Storage.Components;
using NUnit.Framework;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests
{
[TestFixture]
public sealed class StorageFillTest : ContentIntegrationTest
{
[Test]
public async Task TestStorageFillPrototypes()
{
var server = StartServer();
await server.WaitIdleAsync();
var protoManager = server.ResolveDependency<IPrototypeManager>();
await server.WaitAssertion(() =>
{
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (!proto.TryGetComponent<StorageFillComponent>("StorageFill", out var storage)) continue;
foreach (var entry in storage.Contents)
{
Assert.That(entry.Amount, Is.GreaterThan(0), $"Specified invalid amount of {entry.Amount} for prototype {proto.ID}");
Assert.That(entry.SpawnProbability, Is.GreaterThan(0), $"Specified invalid probability of {entry.SpawnProbability} for prototype {proto.ID}");
}
}
});
}
}
}