예제 #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiPostTypesModelMapper();
            var model  = new ApiPostTypesResponseModel();

            model.SetProperties(1, "A");
            ApiPostTypesRequestModel response = mapper.MapResponseToRequest(model);

            response.Type.Should().Be("A");
        }
예제 #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiPostTypesModelMapper mapper = new ApiPostTypesModelMapper();

            UpdateResponse <ApiPostTypesResponseModel> updateResponse = await this.Client.PostTypesUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }
예제 #3
0
        public void CreatePatch()
        {
            var mapper = new ApiPostTypesModelMapper();
            var model  = new ApiPostTypesRequestModel();

            model.SetProperties("A");

            JsonPatchDocument <ApiPostTypesRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiPostTypesRequestModel();

            patch.ApplyTo(response);
            response.Type.Should().Be("A");
        }