Example #1
0
        public void Update_SuccessfullyUpdated()
        {
            // Arrange
            var model      = GetSalesOrderPostModel();
            var result     = _client.Post(model).AssertResult();
            var patchModel = new SalesOrderPatchModel
            {
                Id = result.Id,
                DeliveryAddressId = DeliveryAddressId2,
                Description       = "updated description",
                MyAddress         = new MyDocumentAddressPatchModel
                {
                    AccountNumber = "555777",
                    Iban          = "5453187522"
                }
            };

            // Act
            var data = _client.Update(patchModel).AssertResult();

            // Assert
            Assert.AreEqual(patchModel.Description, data.Description);
            Assert.AreEqual(PartnerId, data.PartnerId);
            Assert.AreEqual(patchModel.MyAddress.AccountNumber, data.MyAddress.AccountNumber);
            Assert.AreEqual(patchModel.MyAddress.Iban, data.MyAddress.Iban);
            AssertDeliveryAddress(data.DeliveryAddress, DeliveryAddressId2);
            _client.Delete(result.Id).AssertResult();
        }
Example #2
0
 /// <inheritdoc />
 public Task <ApiResult <SalesOrderGetModel> > UpdateAsync(SalesOrderPatchModel model, CancellationToken cancellationToken = default)
 {
     return(PatchAsync <SalesOrderPatchModel, SalesOrderGetModel>(model, cancellationToken));
 }
Example #3
0
 /// <inheritdoc/>
 public ApiResult <SalesOrderGetModel> Update(SalesOrderPatchModel model)
 {
     return(Patch <SalesOrderPatchModel, SalesOrderGetModel>(model));
 }