コード例 #1
0
 public void Calculate_OneElementInEquity__EmptyResult()
 {
     CheckForEmpty(EquityDistributionCalculator.Calculate(new List <SystemValue>()
     {
         new SystemValue()
     }));
 }
コード例 #2
0
        public void Calculate__CalculateCorrectly(float[] equityValues, float expectedAvg, float expectedStdDev)
        {
            var equity = equityValues.Select(v => new SystemValue()
            {
                Value = v
            }).ToList();
            var result = EquityDistributionCalculator.Calculate(equity);

            result.Average.ToString("F6").ShouldBe(expectedAvg.ToString("F6"));
            result.StdDev.ToString("F6").ShouldBe(expectedStdDev.ToString("F6"));
        }
コード例 #3
0
 private static void CalculateEquityDistribution(SystemStateSummary summary, SystemState systemState)
 {
     summary.EquityDistribution = EquityDistributionCalculator.Calculate(systemState.Equity);
 }
コード例 #4
0
 public void Calculate_EmptyEquity__EmptyResult()
 {
     CheckForEmpty(EquityDistributionCalculator.Calculate(new List <SystemValue>()));
 }