public async Task GetAccountBalanceForPeriodAsync()
        {
            // Arrange
            _mockConfiguration.Setup(c => c.GetValue(It.IsAny <string>())).Returns("accountperiodbalanceservice-test-01");

            using (var uow = _applicationDbFactory.BeginUnitOfWorkAsync().Result)
            {
                await SeedAccounts(uow);

                var periodId = uow.Periods.GetAll().First(i => i.Discription == "January 2017").PeriodId;

                // Act
                var actualResult = await _accountPeriodBalanceService.GetAccountBalanceForPeriodAsync(periodId);

                // Assert
                Assert.IsTrue(actualResult.Count == 2, "Expected count is 2");
                Assert.IsTrue(actualResult.Any(i => i.AccountName == "R&D"), "Expected result should have R&D");
                Assert.IsTrue(!actualResult.Any(i => i.AccountName == ""), "Account name can not empty");
            }
        }
Ejemplo n.º 2
0
 public async Task <List <AccountPeriodBalanceModel> > GetAccountBalanceForPeriodAsync(int periodid)
 {
     return(await _accountPeriodBalanceService.GetAccountBalanceForPeriodAsync(periodid));
 }