Class FarmingTests
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Farming system dev tests. Written from the perspective of a player learning to write a farming bot. Each test follows the three-phase pattern: Setup → Action (bot API) → Verify.
public class FarmingTests : DevTest
- Inheritance
-
objectFarmingTests
- Inherited Members
Properties
- ExpectedLogErrors
The one error here that is not a defect to fix now, and it is not this test's fault either: the Tomato Plant prefab has neither a MeshFilter nor a SkinnedMeshRenderer, so EquipableBehaviour.OnValidate logs it while PlantAndWaterInPot loads that item. Scoped to that single test rather than the whole class, so a tomato problem in any other test still fails the test that hit it.
Methods
- HarvestMatureCrop()
Hero.Harvest() walks to the nearest mature crop without any learned skill. Actual crop destruction happens via normal combat once the hero is adjacent.
- HarvestWithNoMatureCrop()
Player calls Harvest() but no mature crops are ready — should fail.
- OvergrownCropCannotBeHarvested()
A crop left too long becomes Overgrown. Harvest() should fail on it. Player must re-till to reset the plot.
- PlantAndWaterInPot()
Full planting-pot workflow: place the pot → plant tomato seeds → water it. Covers the common beginner script sequence without tilling.
- PlantSeedsInEmptyPlot()
After tilling, the player's bot plants Tomato seeds in the empty plot. The plot state should change to Planted.
- PlantWithNoPlotNearby()
Player calls Plant() but there's no empty farm plot nearby. The call should fail immediately.
- TillGround()
A new player writes "Hero.Till()" for the first time. They have the FarmingSkill book read, and a Hoe in their inventory. A FarmPlot should appear on the ground at their feet.
- TillSameSpotTwice()
Player tries to till the same spot twice. The second call should be a no-op (no duplicate FarmPlot).
- TillWithoutHoe()
Player tries "Hero.Till()" but forgot to pick up a Hoe. The skill should fail immediately and not start an animation.
- TillWithoutSkill()
Player tries "Hero.Till()" but hasn't read the FarmingSkill book yet. The call should fail immediately.