K1a-Testabdeckung: Cleanup schont aktive Leiter (Floor-Deadlock)
Verifiziert den kritischen K1a-Fix mit Integrationstests statt nur per Review (nach dem K3-Fehlplatzierungs-Fund): - TraderMonitorService._clob -> IClobClient (verhaltensneutral); CleanupStaleOpenOrdersAsync internal. FakeCopyTradeLogRepository ergaenzt. - 2 Tests: Stale Order mit aktiver Leiter wird NICHT gecancelt; ohne Leiter WIRD sie storniert (Kontrast, beweist Nicht-Vacuositaet). Build 0 Fehler, 244 Tests gruen, --smoke-ui ok. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f4045f08e1
commit
2377dc7adb
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using PolyTrader.Modules.CopyTrading.Persistence;
|
||||
using PolyTraderSharp.Models;
|
||||
|
||||
namespace PolyTrader.Tests.Fakes
|
||||
{
|
||||
/// <summary>In-Memory-Stub für <see cref="ICopyTradeLogRepository"/> (Service-Tests).</summary>
|
||||
public sealed class FakeCopyTradeLogRepository : ICopyTradeLogRepository
|
||||
{
|
||||
public List<ClosedTrade> Inserted { get; } = new();
|
||||
|
||||
public void EnsureIndexes() { }
|
||||
public bool Exists(int accountId, string tokenId) => Inserted.Any(t => t.AccountId == accountId && t.TokenId == tokenId);
|
||||
public void Insert(ClosedTrade trade) => Inserted.Add(trade);
|
||||
public int GetMaxTradeId() => Inserted.Count == 0 ? 0 : Inserted.Max(t => t.TradeId);
|
||||
public List<ClosedTrade> Find(Expression<Func<ClosedTrade, bool>> predicate) => Inserted.Where(predicate.Compile()).ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user