コード例 #1
0
ファイル: UnitTest.cs プロジェクト: Pranay-Sagar/Rabobank
        public async Task TestMethod1()
        {
            mandateMethod = new FundMethod();
            var result = await mandateMethod.GetPortfolio();

            result.Should().NotBeNull();
        }
コード例 #2
0
ファイル: UnitTest.cs プロジェクト: Pranay-Sagar/Rabobank
        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();
        }
コード例 #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());
            }
        }