Tests: null-safe role filter in the gear invariant; scratch roleless design drops its role-naming behaviors

The first full Yggdrasil run at 446c1325 failed these two tests (a design with null Roles; the store refusing Radiator's behaviors once its roles were cleared). Builds: yes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-17 16:14:06 +02:00
commit c8deb15b38
2 changed files with 2 additions and 1 deletions

View file

@ -58,7 +58,7 @@ public sealed class ProductLinesCatalogTests
{
using var cache = RestoredHullsTests.OpenCatalog();
var products = cache.GetAll<FactionProductData>().ToArray();
var gear = cache.GetAll<GearData>().Where(d => d is not WeaponItemData && d.Roles.Count > 0).ToArray();
var gear = cache.GetAll<GearData>().Where(d => d is not WeaponItemData && (d.Roles?.Count ?? 0) > 0).ToArray();
Assert.All(OneMakerGear, name => Assert.Contains(gear, d => d.Name == name));
var sold = 0;
foreach (var design in gear.Where(d => !OneMakerGear.Contains(d.Name)))

View file

@ -283,6 +283,7 @@ public sealed class GearLineCommandTests : ProductLinesCommandTests
using (var cache = Open())
{
var radiator = cache.GetAll<GearData>().Single(g => g.Name == "Radiator");
radiator.Behaviors.Clear(); // the store refuses a behavior that names a role the design lacks
radiator.Roles.Clear();
cache.Upsert(radiator);
cache.FlushAsync().Wait();