[
{ "name": "300 plants/m² at TGW 50 g and 80% establishment is 187.5 kg/ha", "args": [300, 50, 8000], "expect": { "kgPerHectare": 187.5, "seedsPerSquareMetre": 375 } },
{ "name": "FAR spring barley example: 225 plants, TGW 40 g, 90% germination x 85% emergence (76.5%) is about 118 kg/ha", "args": [225, 40, 7650], "expect": { "kgPerHectare": 117.6, "seedsPerSquareMetre": 294.1 } },
{ "name": "AHDB wheat benchmark: 260 plants/m² at 70% establishment, TGW 48 g", "args": [260, 48, 7000], "expect": { "kgPerHectare": 178.3, "seedsPerSquareMetre": 371.4 } },
{ "name": "oilseed rape: 50 plants, TGW 5.5 g, 60% establishment", "args": [50, 5.5, 6000], "expect": { "kgPerHectare": 4.6, "seedsPerSquareMetre": 83.3 } },
{ "name": "field beans: 30 plants, TGW 550 g, 90% establishment", "args": [30, 550, 9000], "expect": { "kgPerHectare": 183.3, "seedsPerSquareMetre": 33.3 } },
{ "name": "100% establishment sows exactly the target", "args": [400, 45, 10000], "expect": { "kgPerHectare": 180, "seedsPerSquareMetre": 400 } },
{ "name": "an exact half tenth rounds up: 100 x 45.25 / 100 = 45.25", "args": [100, 45.25, 10000], "expect": { "kgPerHectare": 45.3, "seedsPerSquareMetre": 100 } },
{ "name": "TGW 1.15 g is 1.15 kg/ha exactly and rounds to 1.2, where a float product says 1.1499999999999999", "args": [100, 1.15, 10000], "expect": { "kgPerHectare": 1.2, "seedsPerSquareMetre": 100 } },
{ "name": "TGW is taken to the centigram: 48.004 g is 48 g", "args": [260, 48.004, 7000], "expect": { "kgPerHectare": 178.3, "seedsPerSquareMetre": 371.4 } },
{ "name": "one plant at 0.01% establishment", "args": [1, 1, 1], "expect": { "kgPerHectare": 100, "seedsPerSquareMetre": 10000 } },
{ "name": "zero plants is an error", "args": [0, 50, 8000], "expectError": "targetPlantsPerSquareMetre must be a whole number from 1 to 100000" },
{ "name": "a fractional plant count is an error", "args": [250.5, 50, 8000], "expectError": "targetPlantsPerSquareMetre must be a whole number from 1 to 100000" },
{ "name": "zero TGW is an error", "args": [300, 0, 8000], "expectError": "thousandGrainWeightGrams must be a finite number greater than 0 and at most 1000" },
{ "name": "a TGW that rounds to zero centigrams is an error", "args": [300, 0.004, 8000], "expectError": "thousandGrainWeightGrams must be at least 0.01 grams" },
{ "name": "zero establishment is an error", "args": [300, 50, 0], "expectError": "establishmentBasisPoints must be a whole number from 1 to 10000" },
{ "name": "establishment over 100% is an error", "args": [300, 50, 10001], "expectError": "establishmentBasisPoints must be a whole number from 1 to 10000" },
{ "name": "establishment given as a percentage fraction is an error", "args": [300, 50, 80.5], "expectError": "establishmentBasisPoints must be a whole number from 1 to 10000" }
]