Commit graph Aetheria/tests/Aetheria.Shared.Tests/ShipProductTests.cs
Author SHA1 Message Date
Meta Vens
96bbaa6320 validate shares Read's post-load composition; products, key, price rules pinned beyond the first product
ShipAuthoringStore.ValidateLoaded is the one composition of hull Validate and ValidateProducts;
Read and the draft branch of ship-authoring validate both call it (ValidateProducts is private).
Tests: a draft with an unnamed hull is refused; blank product name and key collision with the
offending product not first (both makers in turn); a negative hull price refused.
Builds untested here; the verify job runs at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 20:00:18 +02:00
Meta Vens
cf149c4280 ValidateJudgesProductsOnADraftAndInspectListsThem: drafts have no model, so validate takes the records-only path the finding names
The first version left the package's GLB in place, so validate judged records and model through ReadPackage and the test failed in the mutation baseline. Test-only; builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 07:03:48 +02:00
Meta Vens
ae3740a050 Fix s2 findings: product validate/inspect/key-collision/price-1 tests; ship_cc.read drops the zero-byte compensator
ship_cc.read lets cultcache-py refuse a zero-byte file (CultLib pins that); the test expects the refusal. New behavioural tests: ValidateJudgesProductsOnADraftAndInspectListsThem (through ShipAuthoringCommands.Run), AProductKeyAlreadyInTheCatalogExcludesThePackage, and price 1 in ASoldPackageHullNeedsAPrice. Tests only plus the add-on deletion; all commits build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 06:38:09 +02:00
Meta Vens
a486a7cae2 ProductAndPriceCommands reads the reopened cache's own product handle; ship_cc.read treats a zero-byte file as holding no records
The test asked a second cache for the handle of an object loaded by the first (identity lookup, no handle); it now asks the reopened cache for its product. cultcache-py raises an Unpack error on a zero-byte file, so ship_cc.read names the empty file through its own shape refusal. Both commits build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 04:38:53 +02:00
Meta Vens
943c492bb8 Packages carry their products: ship.cc homes FactionProductData at mod-product:<id>:<maker key>
ShipAuthoringStore.Load/Read return (Hull, Visual, Products); Open homes the third kind;
WriteProduct/DeleteProduct are the only product writers; ValidateProducts and the ship
top-speed rule; compose checks makers, keys and product names; ship-authoring product and
price commands. Unbuilt until the verify job (Python, pin test and docs follow in the next commit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:54:30 +02:00