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

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

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

            ApiProxyModelMapper mapper = new ApiProxyModelMapper();

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

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

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

            model.SetProperties("A", "A");

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

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