public async Task Should_Success_Get_Report_Include_Previous_Month()
        {
            CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var data     = _dataUtil(service).GetBankExpenditureNotePostedViewModel();
            var unitData = _dataUtil(service).GetNewData_UnitReceiptNotePostedViewModel();

            data.SupplierCode = unitData.SupplierCode;
            data.SupplierName = unitData.SupplierName;
            data.InvoiceNo    = unitData.InvoiceNo;
            data.Mutation     = unitData.DPP + unitData.PPN;
            data.Date         = data.Date.AddMonths(1);
            var memoData = _dataUtil(service).GetMemoPostedViewModel();

            memoData.SupplierCode = unitData.SupplierCode;
            memoData.SupplierName = unitData.SupplierName;
            memoData.InvoiceNo    = unitData.InvoiceNo;
            var tempResponse = await service.CreateFromUnitReceiptNoteAsync(unitData);

            var Response = await service.CreateFromBankExpenditureNoteAsync(data);

            var nextMonthUnitData = _dataUtil(service).GetNewData_UnitReceiptNotePostedViewModel();

            nextMonthUnitData.Date = nextMonthUnitData.Date.AddMonths(1);
            await service.CreateFromUnitReceiptNoteAsync(nextMonthUnitData);

            await service.CreateFromMemoAsync(memoData);

            var reportResponse = service.GetReport(1, 25, data.SupplierName, nextMonthUnitData.Date.Month, nextMonthUnitData.Date.Year, 7);

            Assert.NotEmpty(reportResponse.Item1.Data);
        }
 public async Task Should_Throw_Exception_Create_From_Memo()
 {
     CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
     await Assert.ThrowsAsync <NotFoundException>(() => service.CreateFromMemoAsync(new CreditorAccountMemoPostedViewModel()));
 }
 public async Task Should_Fail_Create_From_Memo()
 {
     CreditorAccountService             service  = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
     CreditorAccountMemoPostedViewModel memoData = new CreditorAccountMemoPostedViewModel();
     await Assert.ThrowsAnyAsync <Exception>(() => service.CreateFromMemoAsync(memoData));
 }