From 18961f79c24fb7f375f7858deb49d08f9c3699b8 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 9 Nov 2022 07:39:15 +1100 Subject: [PATCH] Use linter for vendingmachinetest (#12445) Probably fixes the dependency issue --- .../Tests/VendingMachineTest.cs | 41 ------------------- .../VendingMachineInventoryPrototype.cs | 7 ++-- 2 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 Content.IntegrationTests/Tests/VendingMachineTest.cs diff --git a/Content.IntegrationTests/Tests/VendingMachineTest.cs b/Content.IntegrationTests/Tests/VendingMachineTest.cs deleted file mode 100644 index 3d3b263305..0000000000 --- a/Content.IntegrationTests/Tests/VendingMachineTest.cs +++ /dev/null @@ -1,41 +0,0 @@ -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 - { - [Test] - public async Task Test() - { - await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true}); - var server = pairTracker.Pair.Server; - - await server.WaitAssertion(() => - { - var prototypeManager = IoCManager.Resolve(); - foreach (var vendorProto in prototypeManager.EnumeratePrototypes()) - { - foreach (var (item, _) in vendorProto.StartingInventory) - { - try - { - prototypeManager.Index(item); - } - catch (UnknownPrototypeException) - { - throw new UnknownPrototypeException($"Unknown prototype {item} on vending inventory {vendorProto.ID}"); - } - } - } - }); - - await pairTracker.CleanReturnAsync(); - } - } -} diff --git a/Content.Shared/VendingMachines/VendingMachineInventoryPrototype.cs b/Content.Shared/VendingMachines/VendingMachineInventoryPrototype.cs index 790f365cc5..2945374f87 100644 --- a/Content.Shared/VendingMachines/VendingMachineInventoryPrototype.cs +++ b/Content.Shared/VendingMachines/VendingMachineInventoryPrototype.cs @@ -1,5 +1,6 @@ using Robust.Shared.Prototypes; using Robust.Shared.Serialization; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; namespace Content.Shared.VendingMachines { @@ -10,13 +11,13 @@ namespace Content.Shared.VendingMachines [IdDataField] public string ID { get; } = default!; - [DataField("startingInventory")] + [DataField("startingInventory", customTypeSerializer:typeof(PrototypeIdDictionarySerializer))] public Dictionary StartingInventory { get; } = new(); - [DataField("emaggedInventory")] + [DataField("emaggedInventory", customTypeSerializer:typeof(PrototypeIdDictionarySerializer))] public Dictionary? EmaggedInventory { get; } - [DataField("contrabandInventory")] + [DataField("contrabandInventory", customTypeSerializer:typeof(PrototypeIdDictionarySerializer))] public Dictionary? ContrabandInventory { get; } } }