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

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

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

            Assert.Null(newData.InvoiceNo);
            newData.InvoiceNo = "InvoiceNo";
            var updateResponse = await service.UpdateFromUnitReceiptNoteAsync(newData);

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

            Assert.NotNull(updateData);
        }
 public async Task Should_Throw_Exception_Update_From_URN()
 {
     CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
     await Assert.ThrowsAsync <NotFoundException>(() => service.UpdateFromUnitReceiptNoteAsync(new CreditorAccountUnitReceiptNotePostedViewModel()));
 }
 public async Task Should_Fail_Put_UnitReceiptNote()
 {
     CreditorAccountService service = new CreditorAccountService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
     CreditorAccountUnitReceiptNotePostedViewModel newData = new CreditorAccountUnitReceiptNotePostedViewModel();
     await Assert.ThrowsAnyAsync <Exception>(() => service.UpdateFromUnitReceiptNoteAsync(newData));
 }