예제 #1
0
파일: Program.cs 프로젝트: sbst/code
        static void Main(string[] args)
        {
            var calculator = new HoldingsPercentageCalculator();

            TestAllocations(HoldingDistributionType.Good, calculator);
            TestAllocations(HoldingDistributionType.Bad, calculator);
            TestAllocations(HoldingDistributionType.Extreme, calculator);
            TestAllocations(HoldingDistributionType.Empty, calculator);

            Console.WriteLine("Press Enter to continue ...");
            Console.ReadLine();
        }
예제 #2
0
파일: Program.cs 프로젝트: sbst/code
 private static void TestAllocations(HoldingDistributionType distributionType, HoldingsPercentageCalculator calculator)
 {
     var holdings = HoldingsDistributionFactory.GetDistribution(distributionType);
     var percentageHoldings = calculator.CalculatePercentages(holdings.Holdings);
     PrintResults(holdings, percentageHoldings);
 }