test(dotnet): expand domain parity coverage
This commit is contained in:
@@ -78,6 +78,42 @@ namespace QuantEngine.Core.Tests.ParityTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StopPriceParity_HandlesMissingEntryPrice()
|
||||
{
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
var res = ExitDecisions.ComputeStopPriceCore(null, 3000.0, 100000.0, 2.0);
|
||||
Assert.Null(res.StopPrice);
|
||||
Assert.Equal("NO_STOP_PRICE", res.StopPriceStatus);
|
||||
Assert.Contains("entry_price", res.DataMissing);
|
||||
success = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fixture.RegisterResult(success);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StopPriceParity_HandlesMissingAtrAndMultiplier()
|
||||
{
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
var res = ExitDecisions.ComputeStopPriceCore(100000.0, null, null, null);
|
||||
Assert.Equal(92000.0, res.StopPrice);
|
||||
Assert.Equal("DATA_MISSING — 하네스 업데이트 필요", res.StopPriceStatus);
|
||||
Assert.Contains("atr20", res.DataMissing);
|
||||
success = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fixture.RegisterResult(success);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("STOP_OR_TIME_EXIT_READY", 0, "RISK_ON", 0.0, false, 9999, "EXIT_100")]
|
||||
[InlineData("NORMAL", 4, "RISK_ON", 0.0, false, 9999, "EXIT_100")]
|
||||
@@ -151,6 +187,23 @@ namespace QuantEngine.Core.Tests.ParityTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HeatThresholdParity_DefaultsToBaseThreshold()
|
||||
{
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
var res = ExitDecisions.ComputeDynamicHeatThresholds("");
|
||||
Assert.Equal(10.0, res.HardBlock);
|
||||
Assert.Equal(7.0, res.Halve);
|
||||
success = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fixture.RegisterResult(success);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-5.0, "NORMAL")]
|
||||
[InlineData(5.0, "BREAKEVEN_RATCHET")]
|
||||
@@ -197,5 +250,26 @@ namespace QuantEngine.Core.Tests.ParityTests
|
||||
_fixture.RegisterResult(success);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TimingDecisionParity_RejectsInvalidMarketData()
|
||||
{
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
var ctx = new Dictionary<string, object>
|
||||
{
|
||||
{ "priceStatus", "PRICE_MISSING" }
|
||||
};
|
||||
|
||||
var res = FormulaEngine.ComputeTimingDecision(ctx);
|
||||
Assert.Equal("OBSERVE_DATA_MISSING", res.Action);
|
||||
success = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fixture.RegisterResult(success);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user