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

            data.SupplierCode += "new";
            var newData = await service.GetByBankExpenditureNote(data.SupplierCode, data.Code, data.InvoiceNo);

            Assert.Null(newData);
        }
        public async Task Should_Success_Put_BankExpenditureNote()
        {
            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;
            var tempResponse = await service.CreateFromUnitReceiptNoteAsync(unitData);

            var Response = await service.CreateFromBankExpenditureNoteAsync(data);

            var newData = await service.GetByBankExpenditureNote(data.SupplierCode, data.Code, data.InvoiceNo);

            Assert.NotNull(newData);
            newData.Mutation = 10000;
            var updateResponse = await service.UpdateFromBankExpenditureNoteAsync(newData);

            var updateData = await service.GetByBankExpenditureNote(data.SupplierCode, data.Code, data.InvoiceNo);

            Assert.NotNull(updateData);
        }
Ejemplo n.º 3
0
        public async Task Should_Success_Delete_BankExpenditureNoteList()
        {
            CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var data     = _dataUtil(service).GetBankExpenditureNotePostedViewModel();
            var unitData = _dataUtil(service).GetUnitReceiptNotePostedViewModel();

            unitData.SupplierCode += "deleted";
            unitData.SupplierName += "deleted";
            unitData.InvoiceNo    += "deletd";
            data.SupplierCode      = unitData.SupplierCode;
            data.SupplierName      = unitData.SupplierName;
            data.InvoiceNo         = unitData.InvoiceNo;
            var tempResponse = await service.CreateFromUnitReceiptNoteAsync(unitData);

            var Response = await service.CreateFromBankExpenditureNoteAsync(data);

            var newData = await service.GetByBankExpenditureNote(data.SupplierCode, data.Code, data.InvoiceNo);

            var deleteResponse = await service.DeleteFromBankExpenditureNoteListAsync(newData.Code);

            var deleteData = await service.GetByBankExpenditureNote(data.SupplierCode, data.Code, data.InvoiceNo);

            Assert.Null(deleteData);
        }
        public async Task Should_Return_1_IfNotFound()
        {
            CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var data     = _dataUtil(service).GetBankExpenditureNotePostedViewModel();
            var unitData = _dataUtil(service).GetNewData_UnitReceiptNotePostedViewModel();

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

            var Response = await service.CreateFromBankExpenditureNoteAsync(data);

            var newData = await service.GetByBankExpenditureNote(data.SupplierCode, data.Code, data.InvoiceNo);

            Assert.Null(newData);
        }