public async Task TestMethod1() { mandateMethod = new FundMethod(); var result = await mandateMethod.GetPortfolio(); result.Should().NotBeNull(); }
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(); }
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()); } }