diff --git a/Content.IntegrationTests/Tests/DeltaV/RoboisseurTest.cs b/Content.IntegrationTests/Tests/DeltaV/RoboisseurTest.cs new file mode 100644 index 0000000000..a4c22d5ec8 --- /dev/null +++ b/Content.IntegrationTests/Tests/DeltaV/RoboisseurTest.cs @@ -0,0 +1,68 @@ +using System.Linq; +using Content.Server.Roboisseur.Roboisseur; +using Content.Shared.Item; +using Robust.Shared.GameObjects; +using Robust.Shared.Map; +using Robust.Shared.Prototypes; + +namespace Content.IntegrationTests.Tests.DeltaV; + +[TestFixture] +[TestOf(typeof(RoboisseurSystem))] +public sealed class RoboisseurTest +{ + [Test] + public async Task AllRoboisseurItemsExist() + { + await using var pair = await PoolManager.GetServerClient(); + var server = pair.Server; + // Per RobustIntegrationTest.cs, wait until state is settled to access it. + await server.WaitIdleAsync(); + + var mapManager = server.ResolveDependency(); + var prototypeManager = server.ResolveDependency(); + var entityManager = server.ResolveDependency(); + var entitySystemManager = server.ResolveDependency(); + + var roboisseurSystem = entitySystemManager.GetEntitySystem(); + var roboisseurComponent = new RoboisseurComponent(); + + var testMap = await pair.CreateTestMap(); + + await server.WaitAssertion(() => + { + var allProtos = roboisseurComponent.Tier2Protos.Concat(roboisseurComponent.Tier3Protos) + .Concat(roboisseurComponent.RobossuierRewards); + var enumerable = allProtos as string[] ?? allProtos.ToArray(); + var blacklistedProtos = roboisseurComponent.BlacklistedProtos; + var coordinates = testMap.GridCoords; + + Assert.That(enumerable.Any(), "Roboisseur has no valid prototypes!"); + + foreach (var proto in enumerable) + { + Assert.That(prototypeManager.TryIndex(proto, out var _), + $"Roboisseur has invalid prototype {proto}!"); + + var spawned = entityManager.SpawnEntity(proto, coordinates); + + Assert.That(entityManager.HasComponent(spawned), + $"Roboisseur can request non-item {proto}"); + } + + foreach (var proto in blacklistedProtos) + { + Assert.That(prototypeManager.TryIndex(proto, out var _), + $"Roboisseur has invalid prototype {proto} in blacklist!"); + } + + // Because Server/Client pairs can be re-used between Tests, we + // need to clean up anything that might affect other tests, + // otherwise this pair cannot be considered clean, and the + // CleanReturnAsync call would need to be removed. + mapManager.DeleteMap(testMap.MapId); + }); + + await pair.CleanReturnAsync(); + } +} diff --git a/Content.Server/DeltaV/NPC/Roboisseur/RoboisseurComponent.cs b/Content.Server/DeltaV/NPC/Roboisseur/RoboisseurComponent.cs index d2419e73e4..61cf7df7c6 100644 --- a/Content.Server/DeltaV/NPC/Roboisseur/RoboisseurComponent.cs +++ b/Content.Server/DeltaV/NPC/Roboisseur/RoboisseurComponent.cs @@ -89,16 +89,16 @@ namespace Content.Server.Roboisseur.Roboisseur "FoodSoupChiliClown", "FoodBurgerSuper", "FoodNoodlesCopy", - "FoodMothMallow", + // "FoodMothMallow", "FoodPizzaCorncob", - "FoodPizzDonkpocket", + "FoodPizzaDonkpocket", "FoodSoupMonkey", "FoodMothSeedSoup", "FoodTartGrape", "FoodMealCubancarp", "FoodMealSashimi", "FoodBurgerCarp", - "FoodMealTaco", + "FoodMealSoftTaco", "FoodMothMacBalls", "FoodSoupNettle", "FoodBurgerDuck", @@ -143,7 +143,7 @@ namespace Content.Server.Roboisseur.Roboisseur [DataField("blacklistedProtos")] public IReadOnlyList BlacklistedProtos = new[] { - "FoodMothPesto", + // "FoodMothPesto", "FoodBurgerSpell", "FoodBreadBanana", "FoodMothSqueakingFry", @@ -156,7 +156,6 @@ namespace Content.Server.Roboisseur.Roboisseur "FoodSoupTomato", "FoodDonkpocketGondolaWarm", "FoodDonkpocketBerryWarm", - "LockboxDecloner", "FoodBreadButteredToast", "FoodMothCottonSoup", "LeavesTobaccoDried", @@ -176,7 +175,7 @@ namespace Content.Server.Roboisseur.Roboisseur "FoodPiePumpkinSlice", "FoodDonkpocketTeriyakiWarm", "FoodMothBakedCheese", - "FoodMothTomatoSauce", + // "FoodMothTomatoSauce", "FoodMothPizzaCotton", "AloeCream", "FoodSnackPopcorn", @@ -184,7 +183,7 @@ namespace Content.Server.Roboisseur.Roboisseur "FoodMothToastedSeeds", "FoodMothCornmealPorridge", "FoodMothBakedCorn", - "FoodBreadMoldySlice", + // "FoodBreadMoldySlice", "FoodRiceBoiled", "FoodMothEyeballSoup", "FoodMeatRatKebab", @@ -198,7 +197,7 @@ namespace Content.Server.Roboisseur.Roboisseur "FoodOatmeal", "FoodBreadJellySlice", "FoodMothCottonSalad", - "FoodBreadMoldy", + // "FoodBreadMoldy", "FoodDonkpocketSpicyWarm", "FoodCannabisButter", "FoodNoodles", diff --git a/Resources/migration.yml b/Resources/migration.yml index 1f2f32bcd6..8c66e80ac9 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -147,4 +147,4 @@ RightLegSpider: null WeaponShotgunEnforcerNonLethal: WeaponShotgunEnforcerRubber # 2023-10-06 (Merge related migrations) -RecipeFoodMealTaco: RecipeFoodMealSoftTaco +FoodMealTaco: FoodMealSoftTaco