Beispiel #1
0
        public async Task UpdateAsync_SuccessfullyUpdated()
        {
            var model = new ReceivedInvoicePatchModel
            {
                Id          = _receivedInvoiceIdAsync,
                Description = "DescriptionUpdated"
            };

            // Act
            var data = (await _receivedInvoiceClient.UpdateAsync(model)).AssertResult();

            // Assert
            Assert.AreEqual(model.Description, data.Description);
        }
Beispiel #2
0
        public void Update_SuccessfullyUpdated()
        {
            var model = new ReceivedInvoicePatchModel
            {
                Id          = _receivedInvoiceId,
                Description = "DescriptionUpdated"
            };

            // Act
            var data = _receivedInvoiceClient.Update(model).AssertResult();

            // Assert
            Assert.AreEqual(model.Description, data.Description);
        }
Beispiel #3
0
        public void Update_NotValidModel_ReceivedDocumentNumberTooLong_ThrowException()
        {
            var model = new ReceivedInvoicePatchModel
            {
                Id = _receivedInvoiceId,
                ReceivedDocumentNumber = new string('A', 31)
            };

            // Act
            var exception = Assert.Throws <ValidationException>(() => _receivedInvoiceClient.Update(model));

            // Assert
            Assert.IsNotNull(exception.Message);
            Assert.IsNotEmpty(exception.Message);
        }
 /// <inheritdoc />
 public Task <ApiResult <ReceivedInvoiceGetModel> > UpdateAsync(ReceivedInvoicePatchModel model, CancellationToken cancellationToken = default)
 {
     return(PatchAsync <ReceivedInvoicePatchModel, ReceivedInvoiceGetModel>(model, cancellationToken));
 }
Beispiel #5
0
 /// <inheritdoc />
 public ApiResult <ReceivedInvoiceGetModel> Update(ReceivedInvoicePatchModel model)
 {
     return(Patch <ReceivedInvoicePatchModel, ReceivedInvoiceGetModel>(model));
 }