2020-07-03 00:03:57 +10:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Content.Shared.VendingMachines;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
|
|
|
|
namespace Content.IntegrationTests.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
[TestOf(typeof(VendingMachineInventoryPrototype))]
|
|
|
|
|
public sealed class VendingMachineTest : ContentIntegrationTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public async Task Test()
|
|
|
|
|
{
|
2021-11-06 11:49:59 +01:00
|
|
|
var server = StartServer();
|
|
|
|
|
|
2020-07-03 00:03:57 +10:00
|
|
|
server.Assert(() =>
|
|
|
|
|
{
|
|
|
|
|
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
|
|
|
|
|
foreach (var vendorProto in prototypeManager.EnumeratePrototypes<VendingMachineInventoryPrototype>())
|
|
|
|
|
{
|
|
|
|
|
foreach (var (item, _) in vendorProto.StartingInventory)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
prototypeManager.Index<EntityPrototype>(item);
|
|
|
|
|
}
|
|
|
|
|
catch (UnknownPrototypeException)
|
|
|
|
|
{
|
|
|
|
|
throw new UnknownPrototypeException($"Unknown prototype {item} on vending inventory {vendorProto.Name}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await server.WaitIdleAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-02-11 01:13:03 -08:00
|
|
|
}
|