Exemplo n.º 1
0
        public async Task Should_Success_Posting_Transaction()
        {
            DailyBankTransactionService service = new DailyBankTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var model = _dataUtil(service).GetNewData();
            await service.CreateInOutTransactionAsync(model);

            var response = await service.Posting(new List <int>() { model.Id });

            Assert.True(response > 0);
        }
        public async Task Should_Fail_CreateInOut_Data()
        {
            DailyBankTransactionService service = new DailyBankTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            DailyBankTransactionModel   model   = _dataUtil(service).GetNewData();

            model.Status     = null;
            model.SourceType = "Pendanaan";
            //var Response = await service.CreateInOutTransactionAsync(model);
            await Assert.ThrowsAnyAsync <Exception>(() => service.CreateInOutTransactionAsync(model));
        }
Exemplo n.º 3
0
        public async Task Should_Success_ReportDailyBalance_Excel()
        {
            DailyBankTransactionService service = new DailyBankTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            DailyBankTransactionModel   model   = _dataUtil(service).GetNewData();

            model.Status     = "OUT";
            model.SourceType = "Pendanaan";
            await service.CreateInOutTransactionAsync(model);

            var data = service.GenerateExcelDailyBalance(model.AccountBankId, DateTime.Now.AddDays(-7), DateTime.Now.AddDays(7), "G", 1);

            Assert.NotNull(data);
        }
        public async Task Should_Success_Posting_Pendanaan_Internal_Transaction()
        {
            DailyBankTransactionService service = new DailyBankTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var model = _dataUtil(service).GetNewData();

            model.SourceType        = "Pendanaan";
            model.SourceFundingType = "Internal";
            //model.BankCharges = 100;

            await service.CreateInOutTransactionAsync(model);

            var response = await service.Posting(new List <int>() { model.Id });

            Assert.True(response > 0);
        }
Exemplo n.º 5
0
        public async Task Should_Success_CreateInOut_Data()
        {
            DailyBankTransactionService service = new DailyBankTransactionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            DailyBankTransactionModel   model   = _dataUtil(service).GetNewData();

            model.Status     = "OUT";
            model.SourceType = "Pendanaan";
            var Response = await service.CreateInOutTransactionAsync(model);

            Assert.NotEqual(0, Response);
            var vm = _dataUtil(service).GetDataToValidate();

            vm.Status     = "OUT";
            vm.SourceType = "Pendanaan";
            Assert.True(vm.Validate(null).Count() > 0);
        }