diff --git a/tests/Aetheria.Shared.Tests/ContactRevealTests.cs b/tests/Aetheria.Shared.Tests/ContactRevealTests.cs index 29c5377c2..bfd6a50e4 100644 --- a/tests/Aetheria.Shared.Tests/ContactRevealTests.cs +++ b/tests/Aetheria.Shared.Tests/ContactRevealTests.cs @@ -229,9 +229,13 @@ public sealed partial class ContactRevealTests : IDisposable private EquippableItem Make(string name) => new EquippableItem { - Data = _items.ItemData.RefOf(_items.ItemData.GetByName(name)), Durability = 10, Lot = _nextLot++ + Data = _items.ItemData.RefOf(_items.ItemData.GetByName(name)), Durability = 10, + Lot = _preparedLots.Remove(name, out var prepared) ? prepared : _nextLot++ }; + // Lots a test built through the ItemManager for the next mount of that name, ahead of Add (a ship takes no gear once deployed). + private readonly Dictionary _preparedLots = new Dictionary(); + // A ship at `position` with `mounts` on its sensor hardpoints in order, the tools on free cells and a thruster // on the centre column. A ship with a gun also gets the reactor and targeting a gun needs to fire. private Ship Add(float3 position, string[] mounts = null, string[] tools = null, bool thruster = false) diff --git a/tests/Aetheria.Shared.Tests/EmissionTests.cs b/tests/Aetheria.Shared.Tests/EmissionTests.cs index afcb33ddc..41cd5ea1b 100644 --- a/tests/Aetheria.Shared.Tests/EmissionTests.cs +++ b/tests/Aetheria.Shared.Tests/EmissionTests.cs @@ -327,9 +327,8 @@ public sealed partial class ContactRevealTests { var lot = _items.CreateLot(_openCache.GetByName("Disciplined"), _maker, .123f); _items.Lots[lot].Roles = new List { new RoleFill { Role = "emission-discipline", Quality = discipline } }; - var ship = Add(float3(0, 0, 0), Array.Empty()); - Assert.True(ship.TryEquip(new EquippableItem { Data = _items.ItemData.RefOf(_items.ItemData.GetByName("Disciplined")), Durability = 10, Lot = lot }, new int2(0, 0))); - _zone.Update(0f); + _preparedLots["Disciplined"] = lot; + var ship = Add(float3(0, 0, 0), new[] { "Disciplined" }); Assert.Equal(expected, SensorOf(ship).InterceptFactor, 3); }