Files

54 lines
2.3 KiB
C#

using System;
using System.Threading;
using System.Threading.Tasks;
using FinlyticCore.Dtos.Fundamentals;
using FinlyticCore.Dtos.Sentiment;
using FinlyticCore.Dtos.TechnicalAnalysis;
using FinlyticCore.Dtos.Trading;
using FinlyticEngine.Services.Ai;
using FinlyticEngine.Services.Derivatives;
using FinlyticEngine.Services.Scoring;
namespace FinlyticEngine.Tests.TestSupport;
/// <summary>
/// Fakes for the three <see cref="FinlyticEngine.Services.Trading.TradeLifecycleService"/> dependencies
/// (scoring, AI gate, derivative resolution) that are only reachable through
/// <c>EvaluateAssetAsync</c>. The tenant-boundary tests in this suite never call that method, so these
/// fakes deliberately throw if invoked: a passing test that happened to call one of them without anyone
/// noticing would be a silent, false-positive gap.
/// </summary>
public class NeverInvokedCompositeOpportunityScorer : ICompositeOpportunityScorer
{
public Task<ScoringResult> CalculateCompositeScoreAsync(
StrategyResultDto setup,
IsinSentimentSummaryDto? sentiment,
AssetFundamentalsDto? fundamentals,
FinlyticCore.Dtos.Simulation.StrategyAssetReliabilityDto? reliability = null,
CancellationToken cancellationToken = default)
=> throw new InvalidOperationException("Not expected to be called by the tenant-boundary tests.");
}
public class NeverInvokedAiReasoningGateService : IAiReasoningGateService
{
public Task<AiValidationResultDto> ValidateOpportunityAsync(
StrategyResultDto setup,
IsinSentimentSummaryDto? sentiment,
AssetFundamentalsDto? fundamentals,
ScoringResult score,
FinlyticCore.Dtos.Simulation.StrategyAssetReliabilityDto? reliability = null,
CancellationToken cancellationToken = default)
=> throw new InvalidOperationException("Not expected to be called by the tenant-boundary tests.");
}
public class NeverInvokedKnockOutDerivativeResolver : IKnockOutDerivativeResolver
{
public Task<DerivativeSelectionDto?> ResolveOptimalTurboAsync(
string underlyingIsin,
SignalDirection direction,
decimal chartStopLoss,
decimal currentPrice,
CancellationToken cancellationToken = default)
=> throw new InvalidOperationException("Not expected to be called by the tenant-boundary tests.");
}