Beispiel #1
0
        public void Given_in_a_portfolio_a_position_weighting_may_be_larger_or_smaller_than_its_benchmark_weighting_for_a_given_stock_When_the_tracking_error_for_one_stock_will_always_be_a_positive_number()
        {
            // Criteria 3A

            //* Given a position's weighting (%) may be larger or smaller than it's equivalent benchmark
            //* weighting (%) for a given stock

            //* When the tracking error for one stock is calculated

            //* Then this will always be a positive number (i.e. an absolute difference)
            //Arrange
            var robo = new Stock()
            {
                Symbol = "ROBO"
            };
            //Act
            var actual = fm.CalculateFundPerformanceByStock(robo);
            // Fund weight of ROBO stock = 23.68
            // Benchmark Index weightage for ROBO = 25
            // Error = Fund weightage - Index weightage = -1.32
            // Expected absolute value of Error = 1.32

            var expected = 1.32M;

            // Assert
            Assert.AreEqual(expected, actual.Error);
        }
        public void Given_UK_Equity_Tracker_closely_resembles_the_UK_Corporate_Benchmark_When_there_is_a_stock_symbol_within_both_the_fund_and_the_benchmark_Then_return_the_stock_symbol_with_both_the_position_weighting_and_the_benchmark_weighting()
        {
            //Criteria 2A
            //* Given the UK Equity Tracker closely resembles the UK Corporate Benchmark
            //* When there is a stock symbol within both the fund and the benchmark
            //* Then return the stock symbol with both the position weighting (as %) and the benchmark weighting (as %)
            //Arrange
            var robo = new Stock()
            {
                Symbol = "ROBO"
            };
            //Act
            var actual   = fm.CalculateFundPerformanceByStock(robo);
            var expected = new PerformanceIndicator()
            {
                FundWeightage  = 18.38M,
                IndexWeightage = 25.00M,
                Stock          = robo
            };

            // Assert
            Assert.AreEqual(expected, actual);
        }