Beispiel #1
0
        public void UpdatesRegularValues()
        {
            var response = target.UpdateConfigurationInstance(new ConfigInstance <SampleConfig>(sample, clientId), updatedObject, definition);
            var result   = (SampleConfig)response.GetConfiguration();

            Assert.Equal(updatedSample.Choice, result.Choice);
            Assert.Equal(updatedSample.IsLlamaFarmer, result.IsLlamaFarmer);
            Assert.Equal(updatedSample.Decimal, result.Decimal);
            Assert.Equal(updatedSample.LlamaCapacity, result.LlamaCapacity);
            Assert.Equal(updatedSample.Name, result.Name);
        }
        private async Task HandleValuePostRequest(HttpContext context, ConfigInstance configInstance)
        {
            var input = await context.GetJObjectFromJsonBodyAsync();

            var newConfigInstance = configurationEditPayloadMapper.UpdateConfigurationInstance(configInstance, input, GetConfigurationSetForModel(configInstance));
            await configRepository.UpdateConfigAsync(newConfigInstance);

            responseFactory.BuildNoContentResponse(context);
        }