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

            data.SupplierCode = "UPOputTest";
            data.Code         = "UPOcodePutTest";
            data.InvoiceNo    = null;
            var Response = await service.CreateFromUnitReceiptNoteAsync(data);

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

            Assert.Null(newData.InvoiceNo);
            CreditorAccountUnitPaymentOrderPostedViewModel postedData = new CreditorAccountUnitPaymentOrderPostedViewModel()
            {
                InvoiceNo        = "InvoiceNo",
                CreditorAccounts = new List <CreditorAccountPostedViewModel>()
                {
                    newData
                }
            };
            var updateResponse = await service.UpdateFromUnitPaymentOrderAsync(postedData);

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

            Assert.NotNull(updateData);
        }
        public async Task Should_Success_DeleteBy_UnitReceiptNote()
        {
            CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var data = _dataUtil(service).GetNewData_UnitReceiptNotePostedViewModel();

            data.Code = "TestCodeOnly1";
            var Response = await service.CreateFromUnitReceiptNoteAsync(data);

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

            var deleteResponse = await service.DeleteFromUnitReceiptNoteAsync(newData);

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

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

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

            Assert.Null(newData);
        }
Пример #4
0
        public async Task Should_Success_Get_UnitReceiptNote_WithoutInvoiceNo()
        {
            CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var data = _dataUtil(service).GetUnitReceiptNotePostedViewModel();

            data.InvoiceNo = null;
            var Response = await service.CreateFromUnitReceiptNoteAsync(data);

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

            Assert.NotNull(newData);
        }