fix: parse project rosters with legacy-compatible semantics

This commit is contained in:
codex
2026-08-06 15:14:08 +03:00
parent f460e87253
commit 2c578576d7
8 changed files with 118 additions and 25 deletions
@@ -70,14 +70,15 @@ public sealed class LegacyProductSelectionTests
}
[Fact]
public void ProductIncompatibleAndDuplicateIds_AreBlocked()
public void ProductIncompatibleIds_AreBlocked_AndDuplicateIdsRemainDiagnosticInput()
{
using var fixture = new SelectionFixture();
var project = fixture.ProjectFile("Project.xml");
fixture.WriteAutomatic("Plant PnID_2019", "<root><id>unexpected</id></root>");
Assert.Equal("LEGACY_PLUGIN_PRODUCT_MISMATCH", Assert.Throws<InvalidOperationException>(() => LegacyProductSelections.ReadRoster(LegacyProductSelections.Pnid, project, null, new LegacyConfigurationAdapter())).Message);
fixture.WriteAutomatic("Plant PnID_2019", "<root><id>1111</id><id>1111</id></root>");
Assert.Equal("LEGACY_DOWNLOAD_SELECTION_INVALID", Assert.Throws<InvalidOperationException>(() => LegacyProductSelections.ReadRoster(LegacyProductSelections.Pnid, project, null, new LegacyConfigurationAdapter())).Message);
var duplicatePlan = LegacyProductSelections.ReadRoster(LegacyProductSelections.Pnid, project, null, new LegacyConfigurationAdapter());
Assert.Equal(["1111", "1111"], duplicatePlan.OrderedIds);
}
[Fact]