public async Task UpdateCustomerSetLocale() { var projectLanguages = GetProjectLanguages(client); Assert.True(projectLanguages.Count > 0); //make sure that project has at least one language string locale = projectLanguages[0]; await WithUpdateableCustomer(client, async customer => { Assert.Null(customer.Locale); var action = new SetLocaleUpdateAction { Locale = locale }; var updatedCustomer = await client .ExecuteAsync(customer.UpdateByKey(actions => actions.AddUpdate(action))); Assert.Equal(locale, updatedCustomer.Locale); return(updatedCustomer); }); }
public async Task UpdateReviewSetLocale() { var projectLanguages = GetProjectLanguages(client); Assert.True(projectLanguages.Count > 0); //make sure that project has at least one language string locale = projectLanguages[0]; await WithUpdateableReview(client, async review => { Assert.Null(review.Locale); var updateActions = new List <UpdateAction <Review> >(); var setLocaleAction = new SetLocaleUpdateAction { Locale = locale }; updateActions.Add(setLocaleAction); var updatedReview = await client.ExecuteAsync(new UpdateByIdCommand <Review>(review, updateActions)); Assert.Equal(locale, updatedReview.Locale); return(updatedReview); }); }