#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 { [Test] public async Task TestStorageFillPrototypes() { await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true}); var server = pairTracker.Pair.Server; var protoManager = server.ResolveDependency(); await server.WaitAssertion(() => { foreach (var proto in protoManager.EnumeratePrototypes()) { if (!proto.TryGetComponent("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}"); } } }); await pairTracker.CleanReturnAsync(); } } }