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);
        }
Пример #2
0
        public ComodityViewModel MapToViewModel(Comodity model)
        {
            ComodityViewModel viewModel = new ComodityViewModel();

            PropertyCopier <Comodity, ComodityViewModel> .Copy(model, viewModel);

            return(viewModel);
        }
Пример #3
0
        public Comodity MapToModel(ComodityViewModel viewModel)
        {
            Comodity model = new Comodity();

            PropertyCopier <ComodityViewModel, Comodity> .Copy(viewModel, model);

            return(model);
        }