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

            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);
        }
Exemplo n.º 2
0
        public async Task Should_Throw_Exception_Update_From_UPO()
        {
            CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var response = await service.UpdateFromUnitPaymentOrderAsync(new CreditorAccountUnitPaymentOrderPostedViewModel());

            Assert.Equal(0, response);
        }
        public async Task Should_Success_Put_UnitPaymentOrder_Return_0()
        {
            CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            CreditorAccountUnitPaymentOrderPostedViewModel postedData = new CreditorAccountUnitPaymentOrderPostedViewModel()
            {
                InvoiceNo        = "InvoiceNo",
                CreditorAccounts = null
            };
            var updateResponse = await service.UpdateFromUnitPaymentOrderAsync(postedData);

            Assert.Equal(0, updateResponse);
        }