From e6a17a5e01dd4d34722de7d857f2ecb95f5f1203 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 18 Oct 2026 21:14:14 +0200 Subject: [PATCH] ProductLinesCommandTests: the bins of a removed line go with it, as the catalog read now requires Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/ProductLinesCommandTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/ProductLinesCommandTests.cs b/tests/Aetheria.Shared.Tests/ProductLinesCommandTests.cs index 53b8fe773..fd8e02aa1 100644 --- a/tests/Aetheria.Shared.Tests/ProductLinesCommandTests.cs +++ b/tests/Aetheria.Shared.Tests/ProductLinesCommandTests.cs @@ -42,7 +42,9 @@ public abstract class ProductLinesCommandTests : IDisposable Assert.Equal(Names.Length, products.Length); _shipped = products.Select(p => Describe(cache, p)).OrderBy(x => x, StringComparer.Ordinal).ToArray(); _shippedKeys = products.Select(p => cache.RefOf(p).Key.Value).OrderBy(x => x, StringComparer.Ordinal).ToArray(); - foreach (var product in products) Assert.True(cache.Remove(cache.RefOf(product).Key)); + // A bin cannot outlive its line (the catalog read refuses it), so the bins of the removed lines go with them. + var binned = cache.GetAll().Where(p => p.Bin != null && products.Any(line => cache.RefOf(line).Key.Equals(p.Bin.Line.Key))).ToArray(); + foreach (var product in products.Concat(binned)) Assert.True(cache.Remove(cache.RefOf(product).Key)); cache.FlushAsync().Wait(); }