public async Task Post() { ComodityViewModel VM = GenerateTestModel(); var response = await this.Client.PostAsync(URI, new StringContent(JsonConvert.SerializeObject(VM).ToString(), Encoding.UTF8, "application/json")); Assert.Equal(HttpStatusCode.Created, response.StatusCode); }
public ComodityViewModel MapToViewModel(Comodity model) { ComodityViewModel viewModel = new ComodityViewModel(); PropertyCopier <Comodity, ComodityViewModel> .Copy(model, viewModel); return(viewModel); }
public Comodity MapToModel(ComodityViewModel viewModel) { Comodity model = new Comodity(); PropertyCopier <ComodityViewModel, Comodity> .Copy(viewModel, model); return(model); }