Example #1
0
        public async Task TestMethod()
        {
            mandateMethod = new FundMethod();
            var result = await mandateMethod.ReadFundOfMandatesFile();

            result.Should().NotBeNull();
        }
Example #2
0
        public async Task TestMethod2()
        {
            mandateMethod = new FundMethod();
            var fund = await mandateMethod.ReadFundOfMandatesFile();

            var portFolio = await mandateMethod.GetPortfolio();

            if (fund != null && portFolio != null)
            {
                for (int i = 0; i < portFolio.Positions.Count; i++)
                {
                    foreach (var mandate in fund.FundsOfMandates)
                    {
                        portFolio.Positions[i] = await mandateMethod.GetCalculatedMandates(portFolio.Positions[i], mandate);
                    }
                }
            }
            portFolio.Should().NotBeNull();
        }
Example #3
0
        public async Task <PortfolioVM> Get()
        {
            try
            {
                var fund = await fundMethod.ReadFundOfMandatesFile();

                var portFolio = await fundMethod.GetPortfolio();

                if (fund != null && portFolio != null)
                {
                    for (int i = 0; i < portFolio.Positions.Count; i++)
                    {
                        foreach (var mandate in fund.FundsOfMandates)
                        {
                            portFolio.Positions[i] = await fundMethod.GetCalculatedMandates(portFolio.Positions[i], mandate);
                        }
                    }
                }
                return(portFolio);
            }
            catch (Exception ex) {
                throw new Exception(ex.ToString());
            }
        }