From 61576741eb955d8dc7d386d6a8d2c9372bdb37d5 Mon Sep 17 00:00:00 2001 From: MpakobecEx Date: Fri, 23 Oct 2026 19:11:07 +0500 Subject: [PATCH] Fix Barcgal activated search test for single target --- .../Vanguard.Rules.Tests/GameEngineTests.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs b/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs index bed9275..41ab589 100644 --- a/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs +++ b/server/tests/Vanguard.Rules.Tests/GameEngineTests.cs @@ -857,10 +857,23 @@ public class GameEngineTests Assert.NotNull(engine.State.PendingChoice); Assert.Equal(Step.Choice, engine.State.Step); - Assert.True(engine.Execute(new ChooseCommand(0)).Accepted); + + // If more than one search target remains, pick a card first; the + // engine skips the card prompt when only one copy is left. + if (engine.State.PendingChoice!.Prompt.IndexOf( + "круг", StringComparison.OrdinalIgnoreCase) < 0) + { + var cardIndex = engine.State.PendingChoice.Options + .FindIndex(option => option.Label.Contains("Flogal")); + Assert.GreaterOrEqual(cardIndex, 0); + Assert.True(engine.Execute(new ChooseCommand(cardIndex)).Accepted); + } Assert.NotNull(engine.State.PendingChoice); - Assert.True(engine.Execute(new ChooseCommand(1)).Accepted); + var circleIndex = engine.State.PendingChoice!.Options + .FindIndex(option => option.Slot == 2); + Assert.GreaterOrEqual(circleIndex, 0); + Assert.True(engine.Execute(new ChooseCommand(circleIndex)).Accepted); Assert.Equal( Flogal,