test(dotnet): add 32 xUnit tests for domain calculators (WBS-10.2)
Deploy to Production / Build Release Package (push) Failing after 17s
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 5s
Deploy to Production / Deploy to Production Server (push) Has been skipped
Deploy to Production / Post-Deployment Checks (push) Has been skipped
Snapshot Admin Deployment / build-and-deploy (push) Failing after 38s
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 2m19s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped

This commit is contained in:
2026-06-29 09:59:56 +09:00
parent 7aca1d481b
commit d1278b26ee
35 changed files with 1388 additions and 4 deletions
@@ -0,0 +1,31 @@
using Xunit;
using QuantEngine.Core.Domain;
namespace QuantEngine.Core.Tests
{
public class PullbackTriggerCalculatorTests
{
[Theory]
[InlineData(100000, 100000, 3000, "PULLBACK_ZONE", "PASS")] // close <= ma20*1.03
[InlineData(105000, 100000, 3000, "ABOVE_PULLBACK_ZONE", "BLOCKED")] // close > ma20*1.03
public void ComputePullbackTrigger_Prices_ReturnExpectedVerdictAndState(
double close,
double ma20,
double atr20,
string expectedVerdict,
string expectedState)
{
var res = PullbackTriggerCalculator.ComputePullbackTrigger(close, ma20, atr20);
Assert.Equal(expectedVerdict, res.PullbackEntryVerdict);
Assert.Equal(expectedState, res.PullbackState);
}
[Fact]
public void ComputePullbackTrigger_TriggerPrice_CalculatesCorrectly()
{
// triggerPrice = ma20 - 0.5 * atr20 = 100000 - 1500 = 98500
var res = PullbackTriggerCalculator.ComputePullbackTrigger(100000, 100000, 3000);
Assert.Equal(98500, res.PullbackEntryTriggerPrice);
}
}
}