public async Task UpdateCustomerInStoreByIdSetLastName()
        {
            await WithStore(client, async store =>
            {
                var stores = new List <IReferenceable <Store> >
                {
                    store.ToKeyResourceIdentifier()
                };
                await WithUpdateableCustomer(client,
                                             draft => DefaultCustomerDraftInStores(draft, stores),
                                             async customer =>
                {
                    Assert.NotNull(customer);
                    Assert.Single(customer.Stores);

                    var lastName = TestingUtility.RandomString();
                    var action   = new SetLastNameUpdateAction()
                    {
                        LastName = lastName
                    };

                    var updatedCustomer = await client
                                          .ExecuteAsync(customer.UpdateById(
                                                            actions => actions.AddUpdate(action))
                                                        .InStore(store.ToKeyResourceIdentifier()));

                    Assert.Single(updatedCustomer.Stores);
                    Assert.Equal(store.Key, updatedCustomer.Stores[0].Key);
                    Assert.Equal(lastName, updatedCustomer.LastName);
                    return(updatedCustomer);
                });
            });
        }
        public async Task UpdateCustomerByIdSetLastName()
        {
            await WithUpdateableCustomer(client, async customer =>
            {
                var lastName = TestingUtility.RandomString();
                var action   = new SetLastNameUpdateAction()
                {
                    LastName = lastName
                };

                var updatedCustomer = await client
                                      .ExecuteAsync(customer.UpdateById(actions => actions.AddUpdate(action)));

                Assert.Equal(lastName, updatedCustomer.LastName);
                return(updatedCustomer);
            });
        }