Remove reagent test (#5593)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -1,32 +0,0 @@
|
|||||||
#nullable enable
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Content.Shared.Chemistry.Dispenser;
|
|
||||||
using Content.Shared.Chemistry.Reagent;
|
|
||||||
using NUnit.Framework;
|
|
||||||
using Robust.Shared.Prototypes;
|
|
||||||
|
|
||||||
namespace Content.IntegrationTests.Tests.Solutions
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public sealed class ReagentDispenserTest : ContentIntegrationTest
|
|
||||||
{
|
|
||||||
[Test]
|
|
||||||
public async Task TestReagentDispenserInventory()
|
|
||||||
{
|
|
||||||
var server = StartServer();
|
|
||||||
await server.WaitIdleAsync();
|
|
||||||
var protoManager = server.ResolveDependency<IPrototypeManager>();
|
|
||||||
|
|
||||||
await server.WaitAssertion(() =>
|
|
||||||
{
|
|
||||||
foreach (var proto in protoManager.EnumeratePrototypes<ReagentDispenserInventoryPrototype>())
|
|
||||||
{
|
|
||||||
foreach (var chem in proto.Inventory)
|
|
||||||
{
|
|
||||||
Assert.That(protoManager.HasIndex<ReagentPrototype>(chem), $"Unable to find chem {chem} in ReagentDispenserInventory {proto.ID}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,16 +24,8 @@ namespace Content.IntegrationTests.Tests
|
|||||||
|
|
||||||
foreach (var entry in storage.Contents)
|
foreach (var entry in storage.Contents)
|
||||||
{
|
{
|
||||||
var id = entry.PrototypeId;
|
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}");
|
||||||
if (id == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Assert.That(protoManager.HasIndex<EntityPrototype>(id), $"Unable to find StorageFill prototype of {id} in prototype {proto.ID}");
|
|
||||||
Assert.That(entry.Amount > 0, $"Specified invalid amount of {entry.Amount} for prototype {proto.ID}");
|
|
||||||
Assert.That(entry.SpawnProbability > 0, $"Specified invalid probability of {entry.SpawnProbability} for prototype {proto.ID}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,22 +1,24 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Shared.Chemistry.Dispenser
|
namespace Content.Shared.Chemistry.Dispenser
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is simply a list of reagents defined in yaml. This can then be set as a
|
/// Is simply a list of reagents defined in yaml. This can then be set as a
|
||||||
/// <see cref="ReagentDispenserComponent"/>s <c>pack</c> value (also in yaml),
|
/// <see cref="SharedReagentDispenserComponent"/>s <c>pack</c> value (also in yaml),
|
||||||
/// to define which reagents it's able to dispense. Based off of how vending
|
/// to define which reagents it's able to dispense. Based off of how vending
|
||||||
/// machines define their inventory.
|
/// machines define their inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable, NetSerializable, Prototype("reagentDispenserInventory")]
|
[Serializable, NetSerializable, Prototype("reagentDispenserInventory")]
|
||||||
public class ReagentDispenserInventoryPrototype : IPrototype
|
public class ReagentDispenserInventoryPrototype : IPrototype
|
||||||
{
|
{
|
||||||
[DataField("inventory")]
|
[DataField("inventory", customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
|
||||||
private List<string> _inventory = new();
|
private List<string> _inventory = new();
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
|
|||||||
Reference in New Issue
Block a user