Fix invalid FoodRecipes and add test
This commit is contained in:
44
Content.IntegrationTests/Tests/Kitchen/KitchenTest.cs
Normal file
44
Content.IntegrationTests/Tests/Kitchen/KitchenTest.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
using System.Threading.Tasks;
|
||||||
|
using Content.Shared.Chemistry;
|
||||||
|
using Content.Shared.Prototypes.Kitchen;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
|
namespace Content.IntegrationTests.Tests.Kitchen
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class KitchenTest : ContentIntegrationTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public async Task TestRecipesValid()
|
||||||
|
{
|
||||||
|
var server = StartServerDummyTicker();
|
||||||
|
await server.WaitIdleAsync();
|
||||||
|
|
||||||
|
var protoManager = server.ResolveDependency<IPrototypeManager>();
|
||||||
|
|
||||||
|
await server.WaitAssertion(() =>
|
||||||
|
{
|
||||||
|
foreach (var recipe in protoManager.EnumeratePrototypes<FoodRecipePrototype>())
|
||||||
|
{
|
||||||
|
Assert.That(protoManager.HasIndex<EntityPrototype>(recipe.Result), $"Cannot find FoodRecipe result {recipe.Result} in {recipe.ID}");
|
||||||
|
|
||||||
|
foreach (var (solid, amount) in recipe.IngredientsSolids)
|
||||||
|
{
|
||||||
|
Assert.That(protoManager.HasIndex<EntityPrototype>(solid), $"Cannot find FoodRecipe solid {solid} in {recipe.ID}");
|
||||||
|
Assert.That(amount > 0, $" FoodRecipe {recipe.ID} has invalid solid amount of {amount}");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var (reagent, amount) in recipe.IngredientsReagents)
|
||||||
|
{
|
||||||
|
Assert.That(protoManager.HasIndex<ReagentPrototype>(reagent), $"Cannot find FoodRecipe reagent {reagent} in {recipe.ID}");
|
||||||
|
Assert.That(amount > 0, $" FoodRecipe {recipe.ID} has invalid reagent amount of {amount}");
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.That(recipe.CookTime > 0, $"Cook time of {recipe.CookTime} for FoodRecipe {recipe.ID} is invalid!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2464,7 +2464,7 @@
|
|||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBase
|
parent: FoodBase
|
||||||
id: FoodToastedsandwich
|
id: FoodToastedSandwich
|
||||||
name: toasted sandwich
|
name: toasted sandwich
|
||||||
description: Now if you only had a pepper bar.
|
description: Now if you only had a pepper bar.
|
||||||
components:
|
components:
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 5
|
chem.Flour: 5
|
||||||
solids:
|
solids:
|
||||||
MaskClown: 1
|
ClothingMaskClown: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeTofuBurger
|
id: RecipeTofuBurger
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 15
|
chem.Flour: 15
|
||||||
solids:
|
solids:
|
||||||
Tofu: 1
|
FoodTofu: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeXenoburger
|
id: RecipeXenoburger
|
||||||
@@ -39,26 +39,26 @@
|
|||||||
solids:
|
solids:
|
||||||
FoodXenomeat: 1
|
FoodXenomeat: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeSuperBiteBurger
|
# id: RecipeSuperBiteBurger
|
||||||
name: super bite burger recipe
|
# name: super bite burger recipe
|
||||||
result: FoodSuperBiteBurger
|
# result: FoodSuperBiteBurger
|
||||||
time: 20
|
# time: 20
|
||||||
reagents:
|
# reagents:
|
||||||
chem.Flour: 15
|
# chem.Flour: 15
|
||||||
chem.Salt: 5
|
# chem.Salt: 5
|
||||||
chem.Pepper: 5
|
# chem.Pepper: 5
|
||||||
solids:
|
# solids:
|
||||||
FoodMeat: 5
|
# FoodMeat: 5
|
||||||
FoodCheeseWedge: 3
|
# FoodCheeseWedge: 3
|
||||||
FoodTomato: 4
|
# FoodTomato: 4
|
||||||
FoodEgg: 2
|
# FoodEgg: 2
|
||||||
|
|
||||||
#Breads & Sandwiches
|
#Breads & Sandwiches
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeBread
|
id: RecipeBread
|
||||||
name: bread recipe
|
name: bread recipe
|
||||||
result: FoodContainerBread
|
result: FoodBread
|
||||||
time: 15
|
time: 15
|
||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 15
|
chem.Flour: 15
|
||||||
@@ -90,20 +90,20 @@
|
|||||||
FoodBreadSlice: 2
|
FoodBreadSlice: 2
|
||||||
FoodCheeseWedge: 1
|
FoodCheeseWedge: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeBaguette
|
# id: RecipeBaguette
|
||||||
name: baguette recipe
|
# name: baguette recipe
|
||||||
result: FoodBaguette
|
# result: FoodBaguette
|
||||||
time: 10
|
# time: 10
|
||||||
reagents:
|
# reagents:
|
||||||
chem.Flour: 15
|
# chem.Flour: 15
|
||||||
chem.Salt: 1
|
# chem.Salt: 1
|
||||||
chem.Pepper: 1
|
# chem.Pepper: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeCreamCheeseBread
|
id: RecipeCreamCheeseBread
|
||||||
name: cream cheese bread recipe
|
name: cream cheese bread recipe
|
||||||
result: FoodContainerCreamCheeseBread
|
result: FoodCreamCheeseBread
|
||||||
time: 20
|
time: 20
|
||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 15
|
chem.Flour: 15
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeBananaBread
|
id: RecipeBananaBread
|
||||||
name: banana bread recipe
|
name: banana bread recipe
|
||||||
result: FoodContainerBananaBread
|
result: FoodBananaBread
|
||||||
time: 25
|
time: 25
|
||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 15
|
chem.Flour: 15
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeMargheritaPizza
|
id: RecipeMargheritaPizza
|
||||||
name: margherita pizza recipe
|
name: margherita pizza recipe
|
||||||
result: FoodContainerMargheritaPizza
|
result: FoodMargheritaPizza
|
||||||
time: 30
|
time: 30
|
||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 10
|
chem.Flour: 10
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeMushroomPizza
|
id: RecipeMushroomPizza
|
||||||
name: mushroom pizza recipe
|
name: mushroom pizza recipe
|
||||||
result: FoodContainerMushroomPizza
|
result: FoodMushroomPizza
|
||||||
time: 25
|
time: 25
|
||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 10
|
chem.Flour: 10
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeMeatPizza
|
id: RecipeMeatPizza
|
||||||
name: meat pizza recipe
|
name: meat pizza recipe
|
||||||
result: FoodContainerMeatPizza
|
result: FoodMeatPizza
|
||||||
time: 30
|
time: 30
|
||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 10
|
chem.Flour: 10
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeVegetablePizza
|
id: RecipeVegetablePizza
|
||||||
name: vegetable pizza recipe
|
name: vegetable pizza recipe
|
||||||
result: FoodContainerVegetablePizza
|
result: FoodVegetablePizza
|
||||||
time: 30
|
time: 30
|
||||||
reagents:
|
reagents:
|
||||||
chem.Flour: 10
|
chem.Flour: 10
|
||||||
@@ -212,23 +212,23 @@
|
|||||||
FoodSpaghetti: 1
|
FoodSpaghetti: 1
|
||||||
FoodMeatball: 2
|
FoodMeatball: 2
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeCrabSpaghetti
|
# id: RecipeCrabSpaghetti
|
||||||
name: crab spaghetti recipe
|
# name: crab spaghetti recipe
|
||||||
result: FoodCrabSpaghetti
|
# result: FoodCrabSpaghetti
|
||||||
time: 10
|
# time: 10
|
||||||
reagents:
|
# reagents:
|
||||||
chem.Water: 5
|
# chem.Water: 5
|
||||||
solids:
|
# solids:
|
||||||
FoodCrabMeat: 2
|
# FoodCrabMeat: 2
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeCopypasta
|
# id: RecipeCopypasta
|
||||||
name: copypasta recipe
|
# name: copypasta recipe
|
||||||
result: FoodCopypasta
|
# result: FoodCopypasta
|
||||||
time: 10
|
# time: 10
|
||||||
solids:
|
# solids:
|
||||||
FoodPastaTomato: 2
|
# FoodPastaTomato: 2
|
||||||
|
|
||||||
# - type: microwaveMealRecipe
|
# - type: microwaveMealRecipe
|
||||||
# id: RecipeMoMMISpaghetti
|
# id: RecipeMoMMISpaghetti
|
||||||
@@ -239,53 +239,53 @@
|
|||||||
# chem.Flour: 5
|
# chem.Flour: 5
|
||||||
# solids:
|
# solids:
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeRisotto
|
# id: RecipeRisotto
|
||||||
name: risotto recipe
|
# name: risotto recipe
|
||||||
result: FoodRisotto
|
# result: FoodRisotto
|
||||||
time: 10
|
# time: 10
|
||||||
reagents:
|
# reagents:
|
||||||
chem.Flour: 10 #This should be 10 units of rice.
|
# chem.Flour: 10 #This should be 10 units of rice.
|
||||||
chem.Wine: 5
|
# chem.Wine: 5
|
||||||
solids:
|
# solids:
|
||||||
FoodCheeseWedge: 1
|
# FoodCheeseWedge: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeBruschetta
|
# id: RecipeBruschetta
|
||||||
name: bruschetta recipe
|
# name: bruschetta recipe
|
||||||
result: FoodBruschetta
|
# result: FoodBruschetta
|
||||||
time: 10
|
# time: 10
|
||||||
reagents:
|
# reagents:
|
||||||
chem.Flour: 10
|
# chem.Flour: 10
|
||||||
chem.Salt: 2
|
# chem.Salt: 2
|
||||||
solids:
|
# solids:
|
||||||
FoodGarlic: 1
|
# FoodGarlic: 1
|
||||||
FoodCheeseWedge: 1
|
# FoodCheeseWedge: 1
|
||||||
FoodTomato: 1
|
# FoodTomato: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeQuiche
|
# id: RecipeQuiche
|
||||||
name: quiche recipe
|
# name: quiche recipe
|
||||||
result: FoodQuiche
|
# result: FoodQuiche
|
||||||
time: 10
|
# time: 10
|
||||||
solids:
|
# solids:
|
||||||
FoodBlueTomato: 1
|
# FoodBlueTomato: 1
|
||||||
FoodGarlic: 1
|
# FoodGarlic: 1
|
||||||
FoodEgg: 1
|
# FoodEgg: 1
|
||||||
FoodCheeseWedge: 1
|
# FoodCheeseWedge: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeLasagna
|
# id: RecipeLasagna
|
||||||
name: lasagna recipe
|
# name: lasagna recipe
|
||||||
result: FoodLasagna
|
# result: FoodLasagna
|
||||||
time: 15
|
# time: 15
|
||||||
# reagents:
|
# reagents:
|
||||||
# chem.TomatoJuice: 15
|
# chem.TomatoJuice: 15
|
||||||
solids:
|
# solids:
|
||||||
FoodFlatDough: 2
|
# FoodFlatDough: 2
|
||||||
FoodMeat: 2
|
# FoodMeat: 2
|
||||||
FoodEggplant: 1
|
# FoodEggplant: 1
|
||||||
FoodCheeseWedge: 1
|
# FoodCheeseWedge: 1
|
||||||
|
|
||||||
#Soups & Stew
|
#Soups & Stew
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
@@ -300,29 +300,29 @@
|
|||||||
FoodCarrot: 1
|
FoodCarrot: 1
|
||||||
FoodPotato: 1
|
FoodPotato: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeNettleSoup
|
# id: RecipeNettleSoup
|
||||||
name: nettle soup recipe
|
# name: nettle soup recipe
|
||||||
result: FoodNettleSoup
|
# result: FoodNettleSoup
|
||||||
time: 10
|
# time: 10
|
||||||
reagents:
|
# reagents:
|
||||||
chem.Water: 10
|
# chem.Water: 10
|
||||||
solids:
|
# solids:
|
||||||
FoodNettle: 1
|
# FoodNettle: 1
|
||||||
FoodEgg: 1
|
# FoodEgg: 1
|
||||||
FoodPotato: 1
|
# FoodPotato: 1
|
||||||
|
|
||||||
#Other
|
#Other
|
||||||
- type: microwaveMealRecipe
|
#- type: microwaveMealRecipe
|
||||||
id: RecipeMeatSteak
|
# id: RecipeMeatSteak
|
||||||
name: meat steak recipe
|
# name: meat steak recipe
|
||||||
result: FoodMeatSteak
|
# result: FoodMeatSteak
|
||||||
time: 10
|
# time: 10
|
||||||
reagents:
|
# reagents:
|
||||||
chem.Salt: 1
|
# chem.Salt: 1
|
||||||
chem.Pepper: 1
|
# chem.Pepper: 1
|
||||||
solids:
|
# solids:
|
||||||
FoodMeat: 1
|
# FoodMeat: 1
|
||||||
|
|
||||||
- type: microwaveMealRecipe
|
- type: microwaveMealRecipe
|
||||||
id: RecipeMisoColaSoup
|
id: RecipeMisoColaSoup
|
||||||
|
|||||||
Reference in New Issue
Block a user