feat(wbs): WBS M4/M5 C# domain engines & Vue 3 PrimeVue AG-Grid migration [WBS-10]
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Failing after 12s
Validators (Pushes and Pull Requests) / validate-core (push) Failing after 20s

This commit is contained in:
2026-07-24 11:31:36 +09:00
parent 2fe4cb288f
commit 757f2439af
81 changed files with 3739 additions and 2515 deletions
@@ -0,0 +1,35 @@
using System.Collections.Generic;
using Xunit;
using QuantEngine.Core.Domain;
namespace QuantEngine.Core.Tests;
public class FactorWeightCalibratorTests
{
[Fact]
public void CalibrateWeights_WithValidInputs_SatisfiesBoundsAndShrinkage()
{
// Arrange
var calibrator = new FactorWeightCalibrator();
var baseWeights = new Dictionary<string, decimal>
{
{ "F01_MOMENTUM", 0.30m },
{ "F02_VOLATILITY", 0.20m }
};
var rawWeights = new Dictionary<string, decimal>
{
{ "F01_MOMENTUM", 0.60m }, // Out of bounds raw
{ "F02_VOLATILITY", 0.10m }
};
// Act
var result = calibrator.CalibrateWeights("SS001_v1", baseWeights, rawWeights);
// Assert
Assert.Equal("SS001_v1", result.FormulaId);
Assert.Equal("PASS", result.GateStatus);
Assert.True(result.WeightsWithinBounds);
Assert.True(result.OosComparisonReported);
Assert.Equal(0.45m, result.Weights[0].CalibratedWeight); // Clamped to 0.30 * 1.5 = 0.45
}
}