示例#1
0
        public IEnumerable <CurrencyOperation> GetAllCurrencyOperations([CurrentUserIdGlobalState] int userId,
                                                                        [Service] IBalanceService balanceService, [Service] IPortfolioService portfolioService, int portfolioId)
        {
            var hasPortfolio = portfolioService.GetPortfolios(userId).Any(p => p.UserId == userId);

            if (!hasPortfolio)
            {
                return(new List <CurrencyOperation>());
            }

            return(balanceService.GetAllCurrencyOperations(portfolioId));
        }
        public void GetAllCurrencyOperations()
        {
            var result = _balanceService.GetAllCurrencyOperations(1);

            Assert.AreEqual(2, result.Count());
        }