public void Shop_SellSeveralIdenticalItems() { CraftingChoice randomSword = listCraftingChoices[UnityEngine.Random.Range(0, listCraftingChoices.Count)]; UsableItem sword = GetUsableItemByCraftingChoice(randomSword); //Add between 5 to 10 items int randomItemNumber = UnityEngine.Random.Range(5, 10); for (int i = 0; i < randomItemNumber; i++) { AddItemInInventory(shopAgent.agentInventory, randomSword); agentShopSubSystem.SubmitToShop(shopAgent, sword); } List <UsableItem> shop = agentShopSubSystem.GetShopItems(shopAgent); Assert.NotNull(shop, "Empty shop"); //Check the number of items in the shop AgentData aData = agentShopSubSystem.GetShop(shopAgent); Assert.NotNull(aData, "Empty AgentData"); Assert.AreEqual(randomItemNumber, aData.GetStock(sword), "Wrong stock in AgentData"); Assert.AreEqual(randomItemNumber, agentShopSubSystem.GetNumber(shopAgent, sword.itemDetails), "Wrong stock in AgentShopSubSystem"); //Check price int basePrice = GetPriceByItemName(sword.itemDetails.itemName); Assert.AreEqual(basePrice, agentShopSubSystem.GetPrice(shopAgent, sword.itemDetails)); }