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:
parent
446c13252f
commit
c8deb15b38
2 changed files with 2 additions and 1 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue