Esempio n. 1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiExtensionConfigurationModelMapper();
            var model  = new ApiExtensionConfigurationResponseModel();

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

            response.ExtensionAuthor.Should().Be("A");
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
        }
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiExtensionConfigurationModelMapper mapper = new ApiExtensionConfigurationModelMapper();

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

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

            await this.Cleanup();
        }
Esempio n. 3
0
        public void CreatePatch()
        {
            var mapper = new ApiExtensionConfigurationModelMapper();
            var model  = new ApiExtensionConfigurationRequestModel();

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

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

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