Class DevTest
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Base class for in-game developer tests. Tests run as coroutines in the live game — no NUnit, no scene reload. Editor-only (uses Addressables, Cheats patterns).
Each public method returning IEnumerator is discovered as a test. Group related tests in one class, each method is a separate test case.
public abstract class DevTest
- Inheritance
-
objectDevTest
- Derived
Properties
- BotHero
Current hero's AutomaticHero (bot API — same methods players use in bot scripts).
- Hero
Current hero's CharacterBehaviour.
- HeroPosition
Current hero's position — convenience for spawn placement.
Methods
- Cleanup()
Destroy all objects spawned by this test. Called automatically by DevTestRunner, but tests can also call it manually.
- DoAction(string, Func<ActionResult>, float)
Poll a bot API action (e.g. Equip, DropInto, InteractWith) until it returns Done or fails/times out.
- GetLiquidAmount(LiquidContainerBehaviour, ResourceType)
Get total amount of a specific liquid type in a container.
- GetTotalLiquid(LiquidContainerBehaviour)
Get total liquid amount (all types) in a container.
- GiveItemToHero(ItemBehaviour)
Put an item into the hero's inventory. Heavy items (IsHeavy) are equipped directly instead of going into inventory.
- GiveSkill<T>()
Give the hero a skill. Uses the LootGenerator prefab registry.
- SpawnItem(string, int, ItemRank, int)
Spawn an item by Addressable path. Drops it on the ground near the hero.
- SpawnMonster(string, int, MonsterRank, float)
Spawn a monster by name (must exist in MonsterPool.MonsterPrefabs). Placement is NavMesh-sampled near the hero. Yield a frame after calling to let it initialize.
- SpawnProp(string)
Spawn a prop (non-item like Cauldron) by Addressable path. Placed near hero.
- TrackForCleanup(GameObject)
Track a manually-spawned GameObject for automatic cleanup at end of test.
- WaitUntil(string, Func<bool>, float)
Wait until a condition is true, or throw on timeout.