public void AggregateBonds()
        {
            var bonds1 = _aggregatePortfolioService.AggregateBonds(new[] { 10, 11 }, 1).Count();
            var bonds2 = _aggregatePortfolioService.AggregateBonds(new[] { 10, 11, 12 }, 1).Count();
            var bonds3 = _aggregatePortfolioService.AggregateBonds(new[] { 10 }, 1).Count();
            var bonds4 = _aggregatePortfolioService.AggregateBonds(new[] { 12 }, 2).Count();
            var bonds5 = _aggregatePortfolioService.AggregateBonds(new[] { 12 }, 1).Count();

            Assert.AreEqual(2, bonds1);
            Assert.AreEqual(2, bonds2);
            Assert.AreEqual(2, bonds3);
            Assert.AreEqual(0, bonds4);
            Assert.AreEqual(0, bonds5);
        }
Esempio n. 2
0
        public async Task <List <BondReport> > AggregateBonds(
            [CurrentUserIdGlobalState] int userId,
            [Service] IAggregatePortfolioService aggregatePortfolioService,
            IEnumerable <int> portfolioIds)
        {
            var bonds = aggregatePortfolioService.AggregateBonds(portfolioIds, userId);

            return(await GetBondReports(bonds));
        }